(not actively maintained) codes for programming challenges and practice problems
-
- Important
- Others
- non prime sum sequence
- house robber | max sum without both adjacent values
- two keys keyboard | minimum operations, divisors
- bit count of all numbers till n
- find all subsequenes in arithmetic progression
- integer break | maximize the product of breakup of an integer
- minimum cost of travel tickets
- jump problem
- generate all parentheses
- maximum area of square
- Minimum cost climbing stairs
-
- sub rectangle sum | O(1) sub sum, image processing
- sub rectangle sum extended | sub rectangle that can go outside the array
- monty hall problem
- count steps | recursion
- array manipulation | logic
- primality test | O(sqrt(n))
- largest area within a histogram | stacks, O(n)
- lexicographically next string | string, sorting, logic
- Fisher-Yates algorithm for shuffling
- fast exponent | O(log(exponent))
-
- Binary Search, (binary_search/binary_search.py)
- Binary Search Matrix
- Koko eating bananas
- Searching in rotated array
- Find minimum in rotate array
- search peak element
-
- 2D matrix rotation in place | layers logic
- fraudulent transactions | read the ques carefully
- matching brackets | stacks
- minimum candies | logic
- recursive sum of digits | digit property
- search for pairs of numbers | maps with linked list
- search for pairs of numbers | two pointers
- posinous plants | stacks, O(n), span
- finding majority element in array, | O(n)
- two city scheduling | greedy, custom sort
- fill matrix with 0 | O(1) space
- find missing numbers in array | O(n), logic
- string partitions | O(n), logic
- falling dominoes | logic
- product except self | logic
- best time to buy and sell stock
- longest subarray after deleting an element
-
- Important
- linked list cycle, (data_structures/linked_list_cycle.py)
- linked list reorder in alternating fashion
- sorted doubly linked list | extended implementation
- merge point of linked lists
- queue using two stacks
- flood fill | queue and vector of pairs
- delete duplicates in a linked list | logic, trick
- reverse linked list | O(1) space/iterative; recursive, (data_structures/linked_list_reverse.py)
- stone smashing game | priority queue, greedy
- reveal deck in increasing order | deque
- sort by character frequency | map and priority queue
- next greatest element in array | O(n)
- decode string | O(n)
- min stack
- asteriods collision
- odd even linked list
- senate voting rounds
- Others
- linked list | basic implementation
- reverse linked list
- left rotations of array
- simple text editor | stack
- rotate linked list
- palindromic linked list check
- linked list add numbers
- matching brackets
- evaluate reverse polish notation
- generate well formed parentheses | brute force
- twin sum in linked list
- decode string
- recent events counter
- kth largest element
- Important
-
- Important
- maximum depth of binary tree
- range sum in binary search tree
- diameter of a binary tree
- level order traversal of a binary tree, (trees/level_order.py)
- right side view | logic
- binary tree from inorder and preorder traversal
- longest zigzag path in the tree
- paths in a tree with given sum
- sub paths in a tree with a given sum
- Others
- Important
-
- anagram groups | logic
- longest consecutive sequence | logic
- longest sequence of unique characters,(hashmap/longest_uniq_char_substring.py)
- Permutation in string