Perfect Squares
Problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Examples: Input: »
Problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Examples: Input: »
Problem Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] Output: [ [1,1,2], [1,2, »
Recursion is a great way to come up with permutations of strings or elements. Not necessarily because of the performance (iterative styles are usually faster) but »
Description Given a binary tree with nodes containing integer values (positive or negative), how can you count up all the paths that equal to some target »
Here is one way to do an arithmetic multiply on two positive integers only using <<, >>, and +, without using the * or / operators. The »