Tag: bruteforce algorithm
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, …
Given a range where 0 <= m <= n <= 2147483647 (32 bit), return the bitwise AND of all numbers in this range, inclusive. Example 1: Input: Output: 4 …
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is …
A Rubik cube usually have 6 sides. Take 3×3 rubik cube for example, each side has 9 little squares (1×1), 4 medium squares (2×2) and 1 big square (3×3). …
The sum of the squares of the first ten natural numbers is, 1^2+2^2+3^2+…10^2=385 The square of the sum of the first ten natural numbers is, (1+2+…+10)^2=55^2=3025 Hence the difference …