leetcode-daily-problems-solutions
Leetcode Daily Challenge :
Date | Problem | Solution | Comment |
---|---|---|---|
29/01/2022 | 84. Largest Rectangle in Histogram | Solution | Using 1.Divide and Conquer with/without Segment tree and 2. with stack are two ways |
28/01/2022 | 211. Design Add and Search Words Data Structure | Solution | Add Child to tree. Use DFS to search character by character. Each key is represented in the trie as a path from the root to the internal node or leaf. |
27/01/2022 | 421. Maximum XOR of Two Numbers in an Array | Solution | Convert numbers to Binary and insert them into Bitwise trie one by one. At each step , compute max XOR. |
26/01/2022 | 1305. All Elements in Two Binary Search Trees | Solution | Iterative inorder traversal of both trees in parallel and at each step add smallest value in output |
25/01/2022 | 941. Valid Mountain Array | Solution | After walking up the hill , one should not be at start/end of array. After walking down the hill , one should be at end of array |
24/01/2022 | 520. Detect Capital | Solution | Iterate over characters of string to check if it is uppercase , lowercase or only first letter is upper case |
23/01/2022 | 1291. Sequential Digits | Solution | Using Sliding Window , precompute candidate substrings from input "123456789" and add to result ones that fall in range [low,high] |