From DailyCodingProblem : https://www.dailycodingproblem.com/
-
Day 1: Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
-
Day 2: Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
-
Day 3: Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
-
Day 4: Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.
-
Day 7: Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.
-
Day 447: Implement the pow(x, y) function
-
Day 6 : An XOR linked list is a more memory efficient doubly linked list. Instead of each node holding next and prev fields, it holds a field named both, which is an XOR of the next node and the previous node. Implement an XOR linked list; it has an add(element) which adds the element to the end, and a get(index) which returns the node at index.
-
Day 8 : A unival tree (which stands for "universal value") is a tree where all nodes under it have the same value. Given the root to a binary tree, count the number of unival subtrees.
-
Day 9 : Given a list of integers, write a function that returns the largest sum of non-adjacent numbers. Numbers can be 0 or negative. For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10, since we pick 5 and 5.
-
Day 10 : Implement a job scheduler which takes in a function f and an integer n, and calls f after n milliseconds.
-
Day 11 : Implement an autocomplete system. That is, given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix. For example, given the query string de and the set of strings [dog, deer, deal], return [deer, deal].
-
Day 12 : There exists a staircase with N steps, and you can climb up either 1 or 2 steps at a time. Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters. And What if, instead of being able to climb 1 or 2 steps at a time, you could climb any number from a set of positive integers X? For example, if X = {1, 3, 5}, you could climb 1, 3, or 5 steps at a time.
-
Day 13 : Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters.
-
Day 14 : The area of a circle is defined as πr^2. Estimate π to 3 decimal places using a Monte Carlo method.
-
Day 18 : Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each subarray of length k.
##LeetCode
- **Consecutive Characters **: Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique character. Return the power of the string.
- Binary Tree
- Binary Search Tree
- AVL Tree (Upcoming...)
- Red Black Tree(Upcoming...)
##Others