Given a list of integers, build a complete binary tree using the list as its node weight. Note that a complete binary tree is a binary tree in which every…
A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. A complete…
Dvorak keyboard layout is different from the default QWERT keyboard we used everyday. It's a faster and more ergonomic alternative to the QWERTY layout. Dvorak proponents claim that it requires…
Given a integer, find out its nearest pair of divisors. Sample Input: 28 Sample Output: [4, 7] With the number of 28, there are three pairs of divisors: [1, 28],…
Given a string with lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Note that letters are case sensitive, for example,…
Given a list of integers, move all zeroes to the end of the list while maintaining the relative order of the non-zero numbers. Note that you must do this in-place…
Given a integer N, find out how many trailing zeroes are there for it's factorial result - N!. Sample Input: 10! Sample Output: 2 The factorial of 10 is 3628800,…
Given a string containing brackets characters "(",")","[","]","{" and "}", find out whether it has balanced brackets or not. A string has balanced brackets if: Open brackets must be closed by…
Given a list of words, find out the longest common prefix among them. If there is no common prefix, return an empty string. Sample Input: integer, integrity, integrate, interim Sample…