You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Leetcode-202](https://leetcode.com/problems/happy-number/)| Happy Number |[c++](./leetcode/202.happy-number.cpp), [python3](./leetcode/202.happy-number.py)| Math | O\(S\)| O\(1\)| - |
113
+
|[Leetcode-12](https://leetcode.com/problems/integer-to-roman/)| Integer To Roman |[c++](./leetcode/12.integer-to-roman.cpp), [python3](./leetcode/12.integer-to-roman.py)| Math | O\(N\)| O\(1\)| - |
113
114
|[Leetcode-973](https://leetcode.com/problems/k-closest-points-to-origin/)| K Closest Points To Origin |[c++](./leetcode/973.k-closest-points-to-origin.cpp), [python3](./leetcode/973.k-closest-points-to-origin.py)| Math | O\(NlogN\)| O\(K\)| - |
114
115
|[Leetcode-149](https://leetcode.com/problems/max-points-on-a-line/)| Max Points On A Line |[c++](./leetcode/149.max-points-on-a-line.cpp), [python3](./leetcode/149.max-points-on-a-line.py)| Math | O\(N^2\)| O\(N\)| - |
115
116
|[Leetcode-462](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/)| Minimum Moves To Equal Array Elements II |[c++](./leetcode/462.minimum-moves-to-equal-array-elements-ii.cpp), [python3](./leetcode/462.minimum-moves-to-equal-array-elements-ii.py)| Math | O\(NlogN\)| O\(1\)| - |
116
117
|[Leetcode-326](https://leetcode.com/problems/power-of-three/)| Power Of Three |[c++](./leetcode/326.power-of-three.cpp), [python3](./leetcode/326.power-of-three.py)| Math | O\(1\)| O\(1\)| - |
117
118
|[Leetcode-50](https://leetcode.com/problems/powx-n/)| Powx N |[c++](./leetcode/50.powx-n.cpp), [python3](./leetcode/50.powx-n.py)| Math | O\(logN\)| O\(1\)| - |
|[Leetcode-13](https://leetcode.com/problems/roman-to-integer/)| Roman To Integer |[c++](./leetcode/13.roman-to-integer.cpp), [python3](./leetcode/13.roman-to-integer.py)| Math | O\(N\)| O\(1\)| - |
|[Leetcode-249](https://leetcode.com/problems/group-shifted-strings/)| Group Shifted Strings |[c++](./leetcode/249.group-shifted-strings.cpp)| Other |\-|\-| - |
966
970
|[Leetcode-57](https://leetcode.com/problems/insert-interval/)| Insert Interval |[c++](./leetcode/57.insert-interval.cpp), [python3](./leetcode/57.insert-interval.py)| Other |\-|\-| - |
967
971
|[Leetcode-273](https://leetcode.com/problems/integer-to-english-words/)| Integer To English Words |[python3](./leetcode/273.integer-to-english-words.py)| Other |\-|\-| - |
968
-
|[Leetcode-12](https://leetcode.com/problems/integer-to-roman/)| Integer To Roman |[c++](./leetcode/12.integer-to-roman.cpp), [python3](./leetcode/12.integer-to-roman.py)| Other |\-|\-| - |
969
972
|[Leetcode-349](https://leetcode.com/problems/intersection-of-two-arrays/)| Intersection Of Two Arrays |[c++](./leetcode/349.intersection-of-two-arrays.cpp), [python3](./leetcode/349.intersection-of-two-arrays.py)| Other |\-|\-| - |
970
973
|[Leetcode-350](https://leetcode.com/problems/intersection-of-two-arrays-ii/)| Intersection Of Two Arrays II |[c++](./leetcode/350.intersection-of-two-arrays-ii.cpp), [python3](./leetcode/350.intersection-of-two-arrays-ii.py)| Other |\-|\-| - |
971
974
|[Leetcode-751](https://leetcode.com/problems/ip-to-cidr/)| Ip To Cidr |[python3](./leetcode/751.ip-to-cidr.py)| Other |\-|\-| - |
|[Leetcode-344](https://leetcode.com/problems/reverse-string/)| Reverse String |[c++](./leetcode/344.reverse-string.cpp), [python3](./leetcode/344.reverse-string.py)| Other |\-|\-| - |
1017
1020
|[Leetcode-345](https://leetcode.com/problems/reverse-vowels-of-a-string/)| Reverse Vowels Of A String |[c++](./leetcode/345.reverse-vowels-of-a-string.cpp), [python3](./leetcode/345.reverse-vowels-of-a-string.py)| Other |\-|\-| - |
1018
1021
|[Leetcode-657](https://leetcode.com/problems/robot-return-to-origin/)| Robot Return To Origin |[python3](./leetcode/657.robot-return-to-origin.py)| Other |\-|\-| - |
1019
-
|[Leetcode-13](https://leetcode.com/problems/roman-to-integer/)| Roman To Integer |[c++](./leetcode/13.roman-to-integer.cpp), [python3](./leetcode/13.roman-to-integer.py)| Other |\-|\-| - |
1020
1022
|[Leetcode-61](https://leetcode.com/problems/rotate-list/)| Rotate List |[python3](./leetcode/61.rotate-list.py)| Other |\-|\-| - |
1021
1023
|[Leetcode-702](https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/)| Search In A Sorted Array Of Unknown Size |[c++](./leetcode/702.search-in-a-sorted-array-of-unknown-size.cpp), [python3](./leetcode/702.search-in-a-sorted-array-of-unknown-size.py)| Other |\-|\-| - |
1022
1024
|[Leetcode-444](https://leetcode.com/problems/sequence-reconstruction/)| Sequence Reconstruction |[c++](./leetcode/444.sequence-reconstruction.cpp), [python3](./leetcode/444.sequence-reconstruction.py)| Other |\-|\-| - |
// Seven different symbols represent Roman numerals with the following values:
8
+
//
9
+
//
10
+
//
11
+
// Symbol
12
+
// Value
13
+
//
14
+
//
15
+
//
16
+
//
17
+
// I
18
+
// 1
19
+
//
20
+
//
21
+
// V
22
+
// 5
23
+
//
24
+
//
25
+
// X
26
+
// 10
27
+
//
28
+
//
29
+
// L
30
+
// 50
31
+
//
32
+
//
33
+
// C
34
+
// 100
35
+
//
36
+
//
37
+
// D
38
+
// 500
39
+
//
40
+
//
41
+
// M
42
+
// 1000
43
+
//
44
+
//
45
+
//
46
+
// Roman numerals are formed by appending the conversions of decimal place values from highest to lowest. Converting a decimal place value into a Roman numeral has the following rules:
47
+
//
48
+
// If the value does not start with 4 or 9, select the symbol of the maximal value that can be subtracted from the input, append that symbol to the result, subtract its value, and convert the remainder to a Roman numeral.
49
+
// If the value starts with 4 or 9 use the subtractive form representing one symbol subtracted from the following symbol, for example, 4 is 1 (I) less than 5 (V): IV and 9 is 1 (I) less than 10 (X): IX. Only the following subtractive forms are used: 4 (IV), 9 (IX), 40 (XL), 90 (XC), 400 (CD) and 900 (CM).
50
+
// Only powers of 10 (I, X, C, M) can be appended consecutively at most 3 times to represent multiples of 10. You cannot append 5 (V), 50 (L), or 500 (D) multiple times. If you need to append a symbol 4 times use the subtractive form.
51
+
//
52
+
// Given an integer, convert it to a Roman numeral.
53
+
//
54
+
// Example 1:
55
+
//
56
+
// Input: num = 3749
57
+
// Output: "MMMDCCXLIX"
58
+
// Explanation:
59
+
//
60
+
// 3000 = MMM as 1000 (M) + 1000 (M) + 1000 (M)
61
+
// 700 = DCC as 500 (D) + 100 (C) + 100 (C)
62
+
// 40 = XL as 10 (X) less of 50 (L)
63
+
// 9 = IX as 1 (I) less of 10 (X)
64
+
// Note: 49 is not 1 (I) less of 50 (L) because the conversion is based on decimal places
# Seven different symbols represent Roman numerals with the following values:
8
+
#
9
+
#
10
+
#
11
+
# Symbol
12
+
# Value
13
+
#
14
+
#
15
+
#
16
+
#
17
+
# I
18
+
# 1
19
+
#
20
+
#
21
+
# V
22
+
# 5
23
+
#
24
+
#
25
+
# X
26
+
# 10
27
+
#
28
+
#
29
+
# L
30
+
# 50
31
+
#
32
+
#
33
+
# C
34
+
# 100
35
+
#
36
+
#
37
+
# D
38
+
# 500
39
+
#
40
+
#
41
+
# M
42
+
# 1000
43
+
#
44
+
#
45
+
#
46
+
# Roman numerals are formed by appending the conversions of decimal place values from highest to lowest. Converting a decimal place value into a Roman numeral has the following rules:
47
+
#
48
+
# If the value does not start with 4 or 9, select the symbol of the maximal value that can be subtracted from the input, append that symbol to the result, subtract its value, and convert the remainder to a Roman numeral.
49
+
# If the value starts with 4 or 9 use the subtractive form representing one symbol subtracted from the following symbol, for example, 4 is 1 (I) less than 5 (V): IV and 9 is 1 (I) less than 10 (X): IX. Only the following subtractive forms are used: 4 (IV), 9 (IX), 40 (XL), 90 (XC), 400 (CD) and 900 (CM).
50
+
# Only powers of 10 (I, X, C, M) can be appended consecutively at most 3 times to represent multiples of 10. You cannot append 5 (V), 50 (L), or 500 (D) multiple times. If you need to append a symbol 4 times use the subtractive form.
51
+
#
52
+
# Given an integer, convert it to a Roman numeral.
53
+
#
54
+
# Example 1:
55
+
#
56
+
# Input: num = 3749
57
+
# Output: "MMMDCCXLIX"
58
+
# Explanation:
59
+
#
60
+
# 3000 = MMM as 1000 (M) + 1000 (M) + 1000 (M)
61
+
# 700 = DCC as 500 (D) + 100 (C) + 100 (C)
62
+
# 40 = XL as 10 (X) less of 50 (L)
63
+
# 9 = IX as 1 (I) less of 10 (X)
64
+
# Note: 49 is not 1 (I) less of 50 (L) because the conversion is based on decimal places
0 commit comments