(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
-
- 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
-
- 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
- Others
- Important
-
- Important
- Others
-
- anagram groups | logic
- longest consecutive sequence | logic
- longest sequence of unique characters,(hashmap/longest_uniq_char_substring.py)
- Permutation in string