Category: algorithms
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, …
After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, …
Write a function to check whether a given 32-bit signed integer is a power of 4. Example: If num = 64, return true. and if num = 9, return …
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most …
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: Almost every tree …