Skip to content

Commit 4dd1c7a

Browse files
committed
Added missing READMEs
1 parent 0780fff commit 4dd1c7a

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

contains-duplicate/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 217. Contains Duplicate
2+
3+
[LeetCode link](https://leetcode.com/problems/contains-duplicate/)
4+
5+
Given an integer array `nums`, return `true` if any value appears **at least twice** in the array, and return `false` if every element is distinct.
6+
7+
### Example 1:
8+
9+
> **Input:** `nums = [1,2,3,1]`
10+
>
11+
> **Output:** `true`
12+
13+
### Example 2:
14+
15+
> **Input:** `nums = [1,2,3,4]`
16+
>
17+
> **Output:** `false`
18+
19+
### Example 3:
20+
21+
> **Input:** `nums = [1,1,1,3,3,4,3,2,4,2]`
22+
>
23+
> **Output:** `true`
24+
25+
### Constraints:
26+
27+
> - 1 <= `nums.length` <= 105
28+
> - -109 <= `nums[i]` <= 109
29+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# 3. Longest Substring Without Repeating Characters
2+
3+
[LeetCode Link](https://leetcode.com/problems/longest-substring-without-repeating-characters/)
4+
5+
Given a string s, find the length of the longest
6+
substring without repeating characters.
7+
8+
### Example 1:
9+
10+
> **Input:** `s = "abcabcbb"`
11+
>
12+
> **Output:** `3`
13+
>
14+
> **Explanation:** The answer is`"abc"`, with the length of `3`.
15+
16+
### Example 2:
17+
18+
> **Input:** `s = "bbbbb"`
19+
>
20+
> **Output:** `1`
21+
>
22+
> **Explanation:** The answer is `"b"`, with the length of `1`.
23+
24+
### Example 3:
25+
26+
> **Input:** `s = "pwwkew"`
27+
>
28+
> **Output:** `3`
29+
>
30+
> **Explanation:** The answer is `"wke"`, with the length of `3`.
31+
>
32+
> Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
33+
34+
35+
### Constraints:
36+
37+
- 0 <= `s.length` <= 5 * 104
38+
- `s` consists of English letters, digits, symbols and spaces.
39+
40+
41+

roman-numerals/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# 13. Roman to Integer
2+
3+
[LeetCode Link](https://leetcode.com/problems/roman-to-integer/)
4+
5+
Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`.
6+
7+
```
8+
Symbol Value
9+
I 1
10+
V 5
11+
X 10
12+
L 50
13+
C 100
14+
D 500
15+
M 1000
16+
```
17+
18+
For example, `2` is written as `II` in Roman numeral, just two ones added together. `12` is written as `XII`, which is simply `X + II`. The number `27` is written as `XXVII`, which is `XX + V + II`.
19+
20+
Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not `IIII`. Instead, the number four is written as `IV`. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as `IX`. There are six instances where subtraction is used:
21+
22+
- `I` can be placed before `V` (5) and `X` (10) to make 4 and 9.
23+
- `X` can be placed before `L` (50) and `C` (100) to make 40 and 90.
24+
- `C` can be placed before `D` (500) and `M` (1000) to make 400 and 900.
25+
26+
Given a roman numeral, convert it to an integer.
27+
28+
29+
30+
### Example 1:
31+
32+
> **Input:** `s = "III"`
33+
>
34+
> **Output:** `3`
35+
>
36+
> **Explanation:** `III = 3`.
37+
38+
### Example 2:
39+
40+
> **Input:** `s = "LVIII"`
41+
>
42+
> **Output:** `58`
43+
44+
> **Explanation:** `L = 50, V= 5, III = 3`.
45+
46+
### Example 3:
47+
48+
> **Input:** `s = "MCMXCIV"`
49+
>
50+
> **Output:** `1994`
51+
>
52+
> **Explanation:** `M = 1000, CM = 900, XC = 90 and IV = 4`.
53+
54+
55+
56+
### Constraints:
57+
58+
- 1 <= `s.length` <= 15
59+
- `s` contains only the characters (`'I'`, `'V'`, `'X'`, `'L'`, `'C'`, `'D'`, `'M'`).
60+
- It is guaranteed that `s` is a valid roman numeral in the range `[1, 3999]`.
61+

0 commit comments

Comments
 (0)