Given two sparse matrices A and B, return the result of AB. You may assume that A’s column number is equal to B’s row number. Example: Input: A = …
There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more …
You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may …
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same …