A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Problem | Level | Solution | Remarks | ||||||||||||||||||||||
2 | Contains Duplicate - LeetCode | Easy | arrays_and_hashing/contains-duplicate.rb | Returning false if during frequency map calculation sees frequency > 1 | ||||||||||||||||||||||
3 | Valid Anagram - LeetCode | Easy | arrays_and_hashing/valid-anagram.rb | Check if frequency map is same | ||||||||||||||||||||||
4 | Two Sum - LeetCode | Easy | arrays_and_hashing/two-sum.rb | Store complementary value in hashmap | ||||||||||||||||||||||
5 | Group Anagrams - LeetCode | Medium | arrays_and_hashing/group-anagrams.rb | Store in hashmap array with sorted word as key | ||||||||||||||||||||||
6 | Top K Frequent Elements - LeetCode | Medium | arrays_and_hashing/top-k-frequent-elements.rb | Sort frequency map and first k entries | ||||||||||||||||||||||
7 | Product of Array Except Self - LeetCode | Medium | arrays_and_hashing/product-of-array-except-self.rb | Progressively compute product from both ends and store in two arrays | ||||||||||||||||||||||
8 | Valid Sudoku - LeetCode | Medium | arrays_and_hashing/valid-sudoku.rb | Use transpose to verify colums, iterate matrix in steps of 3 to capture blocks | ||||||||||||||||||||||
9 | 659 ยท Encode and Decode Strings - LintCode | Medium | arrays_and_hashing/encode_decode_strings.rb | Convert characters to ascii and delimit them with any symbol in string form | ||||||||||||||||||||||
10 | Longest Consecutive Sequence - LeetCode | Medium | arrays_and_hashing/longest-consecutive-sequence.rb | In sorted array move cursor to find blocks | ||||||||||||||||||||||
11 | Valid Palindrome - LeetCode | Easy | two_pointers/valid-palindrome.rb | Downcase and replace other characters using regex | ||||||||||||||||||||||
12 | Two Sum II - Input Array Is Sorted - LeetCode | Medium | two_pointers/two-sum-ii-input-array-is-so | Two pointers collapsing from ends | ||||||||||||||||||||||
13 | 3Sum - LeetCode | Medium | two_pointers/3sum.rb | In sorted array find complementary two sums, skip same numbers in all pointers | ||||||||||||||||||||||
14 | Container With Most Water - LeetCode | Medium | two_pointers/container-with-most-water.rb | Min hieght times distance between pointers collapsing from both ends | ||||||||||||||||||||||
15 | Trapping Rain Water - LeetCode | Hard | two_pointers/trapping-rain-water.rb | Create 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 - LeetCode | Easy | stack/valid-parentheses.rb | Push opening brackets to stack. Pop complementary bracket from stack top, otherwise return false. | ||||||||||||||||||||||
17 | Min Stack - LeetCode | Medium | stack/min-stack.rb | Keep one extra stack to store min value till that element | ||||||||||||||||||||||
18 | Evaluate Reverse Polish Notation - LeetCode | Medium | stack/evaluate-reverse-polish-notation.rb | Push 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 |