Given a string s consisting only of 1s and 0s, you can delete any two adjacent letters if they are different. Return the length of the smallest string that …
Given a list of integers, find the largest product of two distinct elements. Example 1 Input nums = Output 35 Explanation 35 is the largest product that can be …
Penny for Your Thoughts Given a positive integer n representing the amount of cents you have, return the formatted currency amount. For example, given n = 123456, return “1,234.56”. …
Given a binary tree root, return the sum of each of the diagonals in the tree starting from the top to bottom right. For example, given 1 / \ …
Given a binary search tree root, and k return the kth (0-indexed) smallest value in root. It is guaranteed that the tree has at least k + 1 nodes. …
Trie is a useful data structure allow us to search a given word or check if any words start with prefix in O(N) efficient time. The following is the …