Daily-Coding-Problems
Daily-Coding-Problems copied to clipboard
Programming problems for practice
Daily Coding Problem
My solutions for programming problems from https://www.dailycodingproblem.com/
If you are looking to help out a fellow programmer, please head over to the Issues Section.
Problem Legend
| Problem ID | Problem | Asked by | Solved status | Solved in |
|---|---|---|---|---|
| 1 | 2-Sum problem | Solved | Python, C++, Java | |
| 2 | Product except self | Uber | Solved | Python, C++ |
| 3 | Serialize and Deserialize Binary Trees | Solved | Python, C++ | |
| 4 | First missing positive | Stripe | Solved | Python, C++ |
| 5 | car, cdr, cons | Jane Street | Solved | Python, C++ |
| 6 | XOR Linked list | Solved | C++ | |
| 7 | Number of ways to decode a message | Solved | Python, C++ | |
| 8 | Universal Value Tree Count | Solved | Python, C++ | |
| 9 | Largest sum of non-adjacent numbers in array | Airbnb | Solved | Python, C++ |
| 10 | Job Scheduler | Apple | Solved | Python, C++ |
| 11 | Autocomplete system | Solved | Python, C++ | |
| 12 | Number of ways to climb a staircase | Amazon | Solved | Python |
| 13 | Longest substring with at most K distinct characters | Amazon | Solved | Python |
| 14 | Pi estimation using Monte Carlo method | Solved | Python | |
| 15 | Random element from large input stream | Solved | Python | |
| 16 | Order Log | Solved | Python | |
| 17 | Longest absolute path in file structure | Solved | Python | |
| 18 | Max of each Subarray | Solved | Python | |
| 19 | House paint problem | Solved | Java | |
| 20 | Intersecting Linked Lists | Solved | Python | |
| 21 | Classroom Scheduling problem | Snapchat | Solved | Python |
| 22 | Word Break | Microsoft | Solved | Python |
| 23 | Number of ways to go from A to B | Unsolved | ||
| 24 | Binary Tree Locking | Solved | Python | |
| 25 | Regular Expression Implementation | Unsolved | ||
| 26 | Remove kth last element in linked list | Solved | Python | |
| 27 | Balanced parantheses | Unsolved | ||
| 28 | Justify text | Palantir | Solved | Python |
| 29 | Run length encoding | Amazon | Solved | Python |
| 30 | Elevation map | Solved | Python, C++ | |
| 31 | Minimum edit distance between two strings | Unsolved | ||
| 32 | Currency Exchange | Jane Street | Unsolved | |
| 33 | Running Median | Microsoft | Solved | Python |
| 34 | Minimum insertion palindrome | Quora | Unsolved | |
| 35 | Swap RGB array in-place | Solved | Python | |
| 36 | Second largest node in binary tree | Dropbox | Solved | Python |
| 37 | Power Set | Solved | Python | |
| 38 | Non-threatening Queens | Microsoft | Solved | Python |
| 39 | Conway's Game of Life | Dropbox | Unsolved | |
| 40 | Non-duplicated item in array | Solved | Python | |
| 41 | Flight itinerary | Solved | Python | |
| 42 | K sum subset | Solved | Python | |
| 43 | Stack Implementation | Amazon | Solved | Python |
| 44 | Count inversions | Solved | Python | |
| 45 | Random number generator | Two Sigma | Solved | Python |
| 46 | Longest palindromic substring | Amazon | Solved | Python |
| 47 | Maximum stock profit | Solved | Python | |
| 48 | Reconstruct binary tree given preorder and postorder traversals | Solved | Python | |
| 49 | Max Sum Subarray or Kadane's algorithm | Amazon | Solved | Python |
| 50 | Binary Tree Arithmetic | Microsoft | Solved | Python, C++ |
| 51 | Deck shuffling with swaps only | Solved | Python | |
| 52 | LRU Cache Implementation | Solved | Python | |
| 53 | Queue Implementation | Apple | Solved | Python |
| 54 | Sudoku solver | Dropbox | Solved | Python |
| 55 | URL shortener | Microsoft | Solved | Python |
| 56 | Graph Coloring | Solved | Python | |
| 57 | String Break | Amazon | Solved | Python |
| 58 | Rotated sorted array search | Amazon | Solved | Python |
| 59 | File Syncing between two computers | Unsolved | ||
| 60 | Equal Sum Partition | Solved | Python | |
| 61 | Integer exponentiation | Solved | Python | |
| 62 | Top-Left to Bottom-Right | Solved | Python | |
| 63 | Word Matrix | Microsoft | Solved | Python |
| 64 | Knight's Tour | Solved | Python | |
| 65 | Spiral Matrix | Amazon | Solved | Python |
| 66 | Unbiased Toss | Square | Solved | Python |
| 67 | LFU Cache Implementation | Solved | Python | |
| 68 | Attacking Bishops | Solved | Python | |
| 69 | Max triplet product | Solved | Python | |
| 70 | Perfect Numbers | Microsoft | Solved | Python |
| 71 | Another Random Number Generator | Microsoft | Solved | Python |
| 72 | Largest Value Path in a Directed Graph | Solved | Python | |
| 73 | Reverse Linked List in-place | Solved | Python | |
| 74 | Count occurrences in multiplication table | Apple | Solved | Python |
| 75 | Largest increasing subsequence | Microsoft | Solved | Python |
| 76 | Lexicographic matrix sort | Solved | Python | |
| 77 | Merge overlapping intervals | Snapchat | Solved | Python |
| 78 | Mergesort linked lists | Solved | Python | |
| 79 | Modifiabale non-decreasing array | Solved | Python | |
| 80 | Deepest Node in Binary Tree | Solved | Python, C++ | |
| 81 | Letter Combinations from Dictionary | Yelp | Solved | Python |
| 82 | Implementation of readN(n) using read7 | Microsoft | Solved | Python |
| 83 | Reverse Binary Tree | Solved | Python | |
| 84 | Island Count | Amazon | Solved | Python |
| 85 | X or Y | Solved | Python | |
| 86 | Min parantheses removal | Solved | Python | |
| 87 | Validate Map | Uber | Solved | Python |
| 88 | Integer division | ContextLogic | Solved | Python |
| 89 | Valid BST | Solved | Python | |
| 90 | Random number generator with exception rule | Solved | Python | |
| 91 | Function correction | Dropbox | Solved | Python |
| 92 | Valid Course Ordering | Airbnb | Solved | Python |
| 93 | Largest BST Size | Apple | Solved | Python |
| 94 | Tree Maximum Path Sum between 2 Leaves | Solved | Python | |
| 95 | Next greater permutation | Palantir | Solved | Python |
| 96 | All permutations | Microsoft | Solved | Python |
| 97 | Time-based Map | Stripe | Solved | Python |
| 98 | Find Word in Grid | Coursera | Solved | Python |
| 99 | Longest Continuous Sequence | Microsoft | Solved | Python |
| 100 | Minimum Step Move | Solved | Python | |
| 101 | Goldbach conjecture | Alibaba | Solved | Python, C++ |
| 102 | Continuous subarray sum equals K | Lyft | Solved | Python |
| 103 | Shortest substring containing given characters | Square | Solved | Python |
| 104 | Palindrome Linked List | Solved | Python | |
| 105 | Function Debounce | Solved | Python | |
| 106 | Hop array to other end | Solved | Python, C++ | |
| 107 | Print binary tree level-wise | Microsoft | Solved | Python, C++ |
| 108 | String shift and check equality | Solved | Python | |
| 109 | Swap even and odd bits | Cisco | Solved | Python |
| 110 | All paths in a binary tree | Solved | Python | |
| 111 | Anagram start-indices in a string | Solved | Python | |
| 112 | LCA of Binary Tree | Solved | Python, C++ | |
| 113 | Reverse words in a string | Solved | Python, C++ | |
| 114 | Reverse words in string with delimiters relative order | Solved | Python, C++ | |
| 115 | Check whether one binary tree is subtree of another | Solved | C++ | |
| 116 | Generate arbitrarily sized binary tree | Jane Street | Solved | C++ |
| 117 | Max Level sum in a binary tree | Solved | C++ | |
| 118 | Sort squares of elements in sorted array | Solved | C++ | |
| 120 | Singleton pattern with twist | Microsoft | Solved | Python |
| 121 | Make palindrome with minimum deletions | Solved | C++, Python | |
| 122 | Collect maximum coins in 2-D matrix | Zillow | Solved | C++, Python |
| 123 | Does string represent a number | Solved | C++ | |
| 124 | Flip coins till only one remains | Microsoft | Solved | C++ |
| 125 | 2-Sum problem in binary tree | Solved | C++ | |
| 126 | Rotate array in-place | Solved | C++ | |
| 127 | Add numbers represented as linked list | Microsoft | Solved | C++ |
| 128 | Tower of Hanoi | Solved | C++ | |
| 129 | Square root of a real number | Solved | C++ | |
| 130 | Maximum profit from k buy-sells | Solved | C++ | |
| 131 | Deep clone linked list having a random pointer at each node | Snapchat | Solved | C++ |
| 132 | Hit Counter class implementation | Riot Games | Solved | C++ |
| 133 | In-Order successor of a node in a binary tree | Amazon | Solved | C++ |
| 134 | Large sparse array data structure | Solved | C++ | |
| 135 | Min root to leaf sum path in binary tree | Apple | Solved | C++ |
| 136 | Largest rectangle in a matrix | Solved | C++ | |
| 137 | Bit array implementation | Amazon | Solved | C++ |
| 138 | Minimum coins for n cents | Solved | C++ | |
| 139 | Peekable iterator | Solved | Python | |
| 140 | Which two elements occur once in array | Solved | C++ | |
| 141 | 3 stacks implementation | Microsoft | Solved | C++ |
| 142 | Balanced parantheses - II | |||
| 143 | List partitioning | Amazon | Solved | C++ |
| 144 | Nearest larger number in an array | Solved | C++ | |
| 145 | Pairwise swap linked list nodes | Solved | C++ | |
| 146 | Binary tree pruning | BufferBox | Solved | C++ |
| 147 | Pancake Sort | Solved | C++ | |
| 148 | Subarray sum | Goldman Sachs | Solved | C++ |
| 149 | Gray code | Apple | Solved | C++ |
| 150 | K nearest neighbors | Solved | C++ | |
| 151 | Color image | Solved | C++ | |
| 152 | Random number generator | Triplebyte | Solved | C++ |
| 153 | Minimum word distance | Solved | C++ | |
| 154 | Stack implementation using heap API | Amazon | Solved | C++ |
| 155 | Majority Element | MongoDB | Solved | C++ |
| 156 | smallest number of squared integers which sum to n | Solved | C++ | |
| 157 | Palindrome string permutation possible | Amazon | Solved | C++ |
| 158 | Walled fort | Solved | C++ | |
| 159 | First recurring character in string | Solved | C++ | |
| 160 | Longest path in tree | Uber | ||
| 161 | Reverse bits | Solved | C++ | |
| 162 | Shortest unique prefix | Square | ||
| 163 | Reverse Polish notation | Jane Street | Solved | C++ |
| 164 | Find the only duplicate in array | Solved | C++ | |
| 165 | Number of smaller elements to the right in an array | Solved | C++ | |
| 166 | 2-D iterator class | Uber | Solved | C++ |
| 167 | Palindrome concatenation pairs | Airbnb | Solved | C++ |
| 168 | Rotate 2-D array in-place | Solved | C++ | |
| 169 | Sort a linked list | Solved | C++ | |
| 170 | Shortest transformation from start word to end word | |||
| 171 | Busiest time interval from a register | Amazon | Solved | C++ |
| 172 | Starting indices of word concatenations in a string | Dropbox | ||
| 173 | Flatten a nested dictionary | Stripe | Solved | Python |
| 174 | Polymorphism examples | Microsoft | Solved | C++ |
| 175 | Markov chain simulation | Solved | C++ | |
| 176 | One-to-one character mapping between two strings | Bloomberg | Solved | C++ |
| 177 | Rotate a linked list | Airbnb | Solved | C++ |
| 178 | Dice Simulation | Two Sigma | Solved | C++ |
| 179 | Recover BST from its postorder traversal | Solved | C++ | |
| 180 | Interleave two halves of a stack using a queue | Solved | C++ | |
| 181 | Minimum number of palindromes in a string | |||
| 182 | Minimally connected graph | Solved | C++ | |
| 183 | What happens when you type a URL | Twitch | Solved | NA |
| 184 | Calculate GCD of numbers | Amazon | Solved | C++ |
| 185 | Calculate intersection area | Solved | C++ | |
| 186 | Divide array into 2 subsets with min difference of subset sums | Microsoft | ||
| 187 | Overlapping rectangles | Solved | C++ | |
| 188 | Array of functions | Solved | C++ | |
| 189 | Longest contiguous distinct subarray | Solved | C++ | |
| 190 | Max sum subarray of circular array | Solved | C++ | |
| 191 | Min intervals to remove to make them non-overlapping | Stripe | Solved | C++ |
| 192 | Try to reach end of array with array value-sized hops | |||
| 193 | Max profit in a stock price array with a fixed transaction fee | Affirm | ||
| 194 | Number of intersections between line segments joining two sets of n points of parallel lines | Solved | C++ | |
| 195 | Count elements between two numbers in a 2-D array | Solved | C++ | |
| 196 | Most frequent subtree sum | Apple | Solved | C++ |
| 197 | Rotate array to the right by K in-place | Amazon | Solved | C++ |
| 198 | Largest set of non-coprime numbers in a set | Solved | C++ | |
| 199 | Balanced parantheses - III | |||
| 200 | Find a stabbing point between n intervals | Microsoft | ||
| 201 | Maximum sum path in a triangular array | |||
| 202 | Integer palindrome | Palantir | Solved | C++ |
| 203 | Minimum element in rotated sorted array in faster than linear time | Uber | Solved | C++ |
| 204 | Count the number of nodes in a complete binary tree in faster than linear time | Amazon | Solved | C++ |
| 205 | Given a number find the next permutation of it | IBM | Solved | C++ |
| 206 | Apply a permutation on an array | Solved | C++ | |
| 207 | Check if a graph is bipartite | Dropbox | ||
| 208 | Partition a linked list by a node such that all elements >= a node come after those smaller | Solved | C++ | |
| 209 | Longest common subsequence of 3 strings | YouTube | ||
| 210 | Collatz conjecture verificity and longest sequence | Apple | Solved | C++ |
| 211 | All starting positions of a pattern in a string | Microsoft | Solved | C++ |
| 212 | Excel column encoding of a positive integer | Dropbox | Solved | C++ |
| 213 | Valid IP address combinations from a string | Snapchat | Solved | C++ |
| 214 | Max continuous ones in binary representation of a number | Stripe | Solved | C++ |
| 291 | Minimum boats to rescue | Glassdoor | Solved | C++ |
| 294 | Min Running Track Path | Square | Solved | C++ |
| 295 | Pascal's Triangle | Stitch Fix | Solved | C++ |
| 296 | Convert sorted array to Balanced BST | Etsy | Solved | C++ |
| 297 | Minimum drinks to satisfy preferences | Amazon | Solved | C++ |
| 298 | Max Run with at most two discrete elements | Solved | C++ | |
| 299 | Min pipe length required for a city graph | Samsung | Solved | C++ |
| 311 | Peak element in array in O(log N) time | Sumo Logic | Solved | C++ |