Problems and their solutions
- Challenge 1: Matrix Chain Multiplication
- Challenge 2: Count total set bits in all numbers from 1 to n
- Challenge 3: Count subsequences of type a^i b^j c^k
- Challenge 4: Given an array of integers, replace every element with the next greatest element (greatest element on the right side) in the array.
- Challenge 5: Highest power of 2 less than or equal to given number
- Challenge 6: Count all possible paths from top left to bottom right of a mXn matrix.
- Challenge 7: Find a pair with maximum product in array of Integers.
- Challenge 8: Given a binary string, count number of substrings that start and end with 1.
- Challenge 9: Given only a pointer/reference to a node to be deleted in a singly linked list, how do you delete it?
- Challenge 10: Write a Program to Find the Maximum Depth or Height of a Tree.
- Challenge 11: Print nodes at k distance from root.
- Challenge 12: Difference between sums of odd level and even level nodes of a Binary Tree.
- Challenge 13: Construct a special tree from given preorder traversal.
- Challenge 14: Tree Isomorphism Problem.
- Challenge 15: Replace all ‘0’ with ‘5’ in an input Integer.[without using array]
- Challenge 16: Pair with given product | Set 1 (Find if any pair exists).
- Challenge 17: Position of rightmost set bit.
- Challenge 18: Print all possible strings that can be made by placing spaces.
- Challenge 19: A Boolean Matrix Question.
- Challenge 20: Count number of occurrences (or frequency) in a sorted array.
- Challenge 21: In given range, print all numbers having unique digits.
- Challenge 22: Given a BST node, find the next highest node in O(log(n)) time.
- CodeJam: Revenge of the Pancakes
- CodeJam: Standing Ovation
- Challenge 23: Given a cost matrix cost and a position (m, n), write a function that returns cost of minimum cost path to reach (m, n) from (0, 0).
- Challenge 24: Traverse border of Binary Tree.
- CodeJam: Senate Evacuation
- CodeJam: Saving The Universe Again
- Challenge 25: Rotate and delete
- Challenge 26: 3 Sum
- Challenge 27: Group Anagrams
- Challenge 28: Longest Substring Without Repeating Characters
- Challenge 28: Longest Palindromic Substring