- Flip your caps: You all will conform | flip your cap(s) puzzle | Level 3.
- Longest increasing subsequence - O(nlogn)*: Find length of longest increasing subsequence from an unsorted array | O(nlogn) | Level 3.
- Print prime numbers: Print all prime numbers from 1 to n, sieve of eratosthenes method | O(sqrt(n)log(log(n))) | Level 3.
- Find min range, k sorted arrays: Find min range which will have elements from all k arrays | O(n * k) | Level 3.
- Min positive integer missing - O(1) space*: Find minimum positive number from an array having random integers | O(n) | Level 3.
- Create sequence of 'a' and 'b': Given 2 numbers A and B, create sequence with at max 2 consecutive 'a' and 'b' | O(A + B) | Level 3.
- Product of elements: Create a array having product of all elements except element at self index | Level 2.
- Happy number: Check if a given number is happy or not | O(n) | Level 2.
- Longest palindrome: Find longest palindrome from a given string | O(n^2) | Level 3.
- Look and say sequence: Print look and say sequence for given number of input lines | O(N) | Level 2.
- Separate positives and negatives: Move all positive to start and negative to end of array, 2 pointer problem, problem adapted from sort array of 0s and 1s | O(n) | Level 2.
- Track kth largest, stream of numbers: Keep track of kth largest number from a stream of numbers | O(k) | Level 2.
- Check prime: Check if a given number is prime or not | O(sqrt(n)) | Level 2.
- Find square root: Find square root of a number using babylonian convergence method | Level 4.
- Count frequency, without space: Count frequency of numbers in array | O(N) time and O(1) space | Level 2.
- Repeating numbers: Find all repeating numbers in a array | O(N) | Level 2.
- Inversion of 3: Find number of combinations which follows: a[i] > a[j] > a[k] with i < j < k in a unsorted array | O(N^2) | Level 2.
- Sorted subsequence of size 3: Find sorted subsequence of size 3 in an unsorted array | O(N) time and space | Level 3.
- Sorted subsequence of size 3, O(1) space: Find sorted subsequence of size 3 in an unsorted array | O(N) time | Level 4.
- Subarray having given sum: Find a sub array(positive numbers) having sum | O(N) | Level 3.
- Triplets in GP: Given a sorted array, print triplets in GP | O(N^2) | Level 2.
- Largest sum of rotated subarray: Find max sum of rotated subarray | O(N) | Level 3.
- Triplet having given sum: Find triplets in a sorted array which sums to a given sum | O(N^2) | Level 2.
- Triplet having smaller sum: Find triplets in a sorted array which sums less than given sum | O(N^2) | Level 2.
- Distinct pairs: Find number of distinct pairs in unsorted array | O(N) | Level 4.
- Count 0s in sorted array: Given a sorted array of 1s and 0s, find number of 0s in that array | O(logn) | Level 2.
- Merge required to make palindrome: Number of merge operations required to make an unsorted array palindrome | O(N) | Level 2.
- Jolly jumper sequence: Check if an unsorted array is jolly jumper sequence | O(N) | Level 2.
- Min number not possible: Find the min num not possible as any subset of sorted array | O(N) | Level 4.
- Subarray with equal 0 and 1: Find max subarray having equal 0s and 1s | O(N^2) | Level 2.
- Max diff btwn elements: Find max diff btwn 2 elements in array such that larger appears later | O(N) | Level 2.
- Maximize index diff: Find max(j - i) such that A[j] > A[i] | O(N) | Level 3.
- Max subarray len, arrange contiguous: Max subarray len whose elements can be arranged in contiguous sequence | O(N^2) | Level 2.
- String anagram having given md5 hash: Given an input string, md5 hashes and long list of words, find anagram of given string which has given hash | Level 3.
- Max product of subarray, size k: Find max product of a subarray, size k | O(N) | Level 2.
- Max and min product of subset: Find max and min product of subset in array | O(N) | Level 2.
- Max subarray product, 2 traversal: Find max subarray product, 2 traversals used | O(N) | Level 3.
- Max subarray product, single traversal*: Find max subarray product, single traversal | O(N) | Level 3.
- Triplet with max product: Find triplet in array with max product | O(N) | Level 2.
- Max product - index diff and min: Find max value of abs(i - j) * MIN(a[i], a[j]) from unsorted array | O(N) | Level 2.
- Max product of increasing triplet: Find max product of increasing triplet from unsorted array | O(N^2) | Level 3.
- Max min, value index pair: Find max value of (a[i] - i) - (a[j] - j) from an unsorted array | O(N) | Level 2.
- Min unique array sum: Increment array elements until all elements become unique and find sum of all unique elements | O(N) | Level 2.
- Max K such that K elements >= K: Find max k such that array has k elements greater than equal to k | O(N) | Level 2.
- Min subarray len, sum > X: Min subarray len having sum greater than X | O(N) | Level 2.
- Max sum with no elements adjacent: Find max sum with no 2 elements adjacent | O(N) | Level 3.
- Longest bitonic subsequence: Find longest bitonic subsequence in a array | O(N) | Level 3.
- Rotations to maximize sum(i * a[i]): Find number of right rotations required to maximize sum(i * a[i]) | O(N) | Level 2.
- RGB merging, get min count: Array has RGBs, merge different element and get min elements left O(N) | Level 2.
- Count strictly increasing subarrays: Count the number of strictly increasing subarrays possible | O(N) | Level 2.
- Count subarrays with even sum: Given an unsorted array, count the number of subarrays with even sum | O(N) | Level 3.
- Max sum path, 2 sorted arrays: Given 2 sorted arrays, find max sum path | O(M + N) | Level 3.
- Stock buy sell to maximize profit: Given stock prices, find days to buy and sell so that profit can be maximized | O(N) | Level 3.
- Merge 2 sorted arrays as contiguous sorted: Given 2 sorted arrays, merge them as contiguous sorted arrays | O(M * N) | Level 4.
- Steps to get given array: Find the number of steps required to get given array from all 0s array | O(K * N) | Level 2.
- Index of 0 flipped to get max 1 seq: Find the index of 0 to be changed to 1 to get max 1s sequence | O(N) | Level 3.
- Max sum after k negations: Find max sum of array elements after k negations | O(K * N) | Level 2.
- Max 0s after flipping subarray - O(N^2): Find max 0s in binary array after flipping a subarray | O(N^2) | Level 2.
- Max 0s after flipping subarray - O(N): Find max 0s in binary array after flipping a subarray | O(N) | Level 3.
- Left/right rotate array: Rotate array left or right by given number of times | O(N) | Level 3.
- Knight's shortest path: Find shortest path from source to destination for a knight on NxN board | BFS | O(N^2) | Level 3.
- Radix sort: Implement radix sort | O(digits * (n + base)) | Level 4.
- Karatsuba algo: Efficient way to multiply 2 numbers, karatsuba algo.
- Generic linked list: Generic linked list in C language | Level 3.
- JSON parser: Partial JSON parser, Ecko question | Level 2.
- Nodes with distance K in binary tree: Print all nodes which are K distance away from given node in binary tree | O(N) | Level 4.
- Odd occurring numberr: A array has all numbers occurring even numbers of times and 2 occurring odd number of times, find these 2 numbers | O(N) | Level 2.
- Even occurring numbers: Find 2 numbers in array(numbers from 1 to n - 2) occurring even number of times, other all occur odd number of times | O(N) | Level 3.
- Longest increasing subsequence - O(n^2): Find length of longest increasing subsequence from an unsorted array | O(n^2) | Level 3.