Category: algorithms
Return all non-negative integers of length N such that the absolute difference between every two consecutive digits is K. Note that every number in the answer must not have …
Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Each of the digits 1-9 must …
Given two integers n and k, return all possible combinations of k numbers out of 1 … n. Example: Input: n = 4, k = 2 Output: , , …
The Fibonacci numbers are defined as the following sequence, with the current item is the sum of the previous two items. F(1) = 0 F(2) = 1 F(N) = …
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Input: num1 = “2”, num2 …