- Spiral print of a matrix
- Given a tree (which has left, right, and previous pointers), you need to populate each previous pointer to point to its previous left node. If there is no previous left node, the previous pointer should be set to NULL.
- Print all the possible permutations of a string. Then he asked me to modify my code so that there were no duplicates
- To print all the subsequences of a string.
- There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i]. It costs cost[i] of gas to travel from the station to its next (i + 1) station. Given two integer arrays of gas and cost, return the starting gas station’s index if you can travel around the circuit once in the clockwise direction with enough gas, otherwise, return -1. He wanted an O(n) approach.
- Implement a function which, given an array of integers, returns a new array for which every index carries the value of the product of the remaining elements - should be O(n)
- Replace every array element by multiplication of previous and next
-
Remove Duplicates from Sorted Array, leetcode 26
-
Missing number, leetcode 268
-
Reverse characters using two pointers
-
Rotate Array, leetcode 189
-
Container With Most Water, leetcode 11
-
Consider a string S, that is a series of characters, each followed by its frequency as an integer. The string is not compressed correctly, so there may be multiple occurrences of the same character. A properly compressed string will consist of one instance of each character in alphabetical order followed by the total count of that character within the string. The string 'a3c9b2c1' has two instances where 'c is followed by a count: once with 9 occurrences, and again with 1. It should be compressed to 'a3b2c10'.
-
Valid Sudoku, leetcode 36
-
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings, encode and decode, leetcode 271
-
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. leetcode 128
-
3sum, leetcode 15
-
Trapping Rain Water, leetcode 42
-
Valid Parentheses, leetcode 20
-
Min Stack, leetcode 155
-
Two sum, leetcode 1
-
Two Sum II - Input Array Is Sorted, leetcode 167
-
Contains Duplicate, leetcode 217
-
Top K Frequent Elements, leetcode 347
-
The kth Factor of n, leetcode 1492
-
Valid Palindrome, leetcode 125
-
First Unique Character in a String, 387
-
Best Time to Buy and Sell Stock, leetcode 121
-
Product of Array Except Self, leetcode 238
-
Best Time to Buy and Sell Stock 2, leetcode 122
-
Evaluate Reverse Polish Notation, leetcode 150
-
Generate Parentheses, leetcode 22
-
Daily Temperatures, leetcode 739
-
Next Greater Element I, leetcode 496
-
Car Fleet, leetcode 853
-
Largest Rectangle in Histogram, leetcode 84
-
Binary Search, leetcode 704
-
Search a 2D Matrix, leetcode 74
-
Koko Eating Bananas, leetcode 875
-
Find Minimum in Rotated Sorted Array, leetcode 153
-
Search in Rotated Sorted Array, leetcode 33
-
Time Based Key-Value Store, leetcode 981
-
Median of Two Sorted Arrays, leetcode 4
-
Kadane's Algorithm, not a binary search topic
- Longest Substring Without Repeating Characters, leetcode 3
- Longest Repeating Character Replacement, leetcode 424
- Permutation in String, leetcode 567
- Minimum Window Substring, leetcode 76
- Sliding Window Maximum, leetcode 239
- Reverse Linked List, leetcode 206
- Merge Two Sorted Lists, leetcode 21
- Reorder List, leetcode 143
- Remove Nth Node From End of List, leetcode 19
- Copy List with Random Pointer, leetcode 138
- Add Two Numbers, leetcode 2
- Detect a cycle Linked List, leetcode 141
- Find the Duplicate Number, leetcode 287
- LRU Cache, leetcode 146
- Merge k Sorted Lists, leetcode 23
- Reverse Nodes in k-Group, leetcode 25
- Invert Binary Tree, leetcode 226
- Maximum Depth of Binary Tree, leetcode 104
- Diameter of Binary Tree, leetcode 543
- Balanced Binary Tree, leetcode 110
- Same Tree, leetcode 100
- Subtree of Another Tree, leetcode 572
- Lowest Common Ancestor of a Binary Search Tree, leetcode 325
- Binary Tree Level Order Traversal, leetcode 102
- Binary Tree Right Side View, leetcode 199