ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Problem
Level
SolutionRemarks
2
Contains Duplicate - LeetCodeEasyarrays_and_hashing/contains-duplicate.rbReturning false if during frequency map calculation sees frequency > 1
3
Valid Anagram - LeetCodeEasyarrays_and_hashing/valid-anagram.rbCheck if frequency map is same
4
Two Sum - LeetCodeEasyarrays_and_hashing/two-sum.rbStore complementary value in hashmap
5
Group Anagrams - LeetCodeMediumarrays_and_hashing/group-anagrams.rbStore in hashmap array with sorted word as key
6
Top K Frequent Elements - LeetCodeMediumarrays_and_hashing/top-k-frequent-elements.rbSort frequency map and first k entries
7
Product of Array Except Self - LeetCodeMediumarrays_and_hashing/product-of-array-except-self.rbProgressively compute product from both ends and store in two arrays
8
Valid Sudoku - LeetCodeMediumarrays_and_hashing/valid-sudoku.rbUse transpose to verify colums, iterate matrix in steps of 3 to capture blocks
9
659 ยท Encode and Decode Strings - LintCodeMediumarrays_and_hashing/encode_decode_strings.rbConvert characters to ascii and delimit them with any symbol in string form
10
Longest Consecutive Sequence - LeetCodeMediumarrays_and_hashing/longest-consecutive-sequence.rbIn sorted array move cursor to find blocks
11
Valid Palindrome - LeetCodeEasytwo_pointers/valid-palindrome.rbDowncase and replace other characters using regex
12
Two Sum II - Input Array Is Sorted - LeetCodeMediumtwo_pointers/two-sum-ii-input-array-is-soTwo pointers collapsing from ends
13
3Sum - LeetCodeMediumtwo_pointers/3sum.rbIn sorted array find complementary two sums, skip same numbers in all pointers
14
Container With Most Water - LeetCodeMediumtwo_pointers/container-with-most-water.rbMin hieght times distance between pointers collapsing from both ends
15
Trapping Rain Water - LeetCodeHardtwo_pointers/trapping-rain-water.rbCreate two arrays of max heights on left and right for each bar. Area possible on each bar is min(l, r) - height[i]
16
Valid Parentheses - LeetCodeEasystack/valid-parentheses.rbPush opening brackets to stack. Pop complementary bracket from stack top, otherwise return false.
17
Min Stack - LeetCodeMediumstack/min-stack.rbKeep one extra stack to store min value till that element
18
Evaluate Reverse Polish Notation - LeetCodeMediumstack/evaluate-reverse-polish-notation.rbPush numbers to stack and pop a pair when operator is found, push the result back
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100