Click here for the google spreadsheet organizing the questions by category and linked to the solution I wrote for each of them. This is always up to date with the README (with the power of a python script and GitHub workflows).
Number | Question | Hints | Python Solution | C++ Solution |
---|---|---|---|---|
1 | Two Sum | Use a hash table to keep track of the indices of the numbers you've encountered so far. | Python Solution | C++ Solution |
56 | Merge Intervals | Sort the intervals by increasing start time. | Python Solution | |
66 | Plus One | Try iterating through each digit backwards. What do you do when the digit is a 9? | Python Solution | |
88 | Merge Sorted Array | Look at one element from each of the arrays, compare them, and make a decision depending on their relation to each other. | Python Solution | |
122 | Best Time to Buy and Sell Stock II | What should we do every time there is a valley followed by a peak in price? | Python Solution | |
217 | Contains Duplicate | Maintain a hash set that keeps track of the numbers we've encountered so far. | Python Solution | |
344 | Reverse String | Use the two pointer approach. Try implementing an iterative and recursive solution. | Python Solution |