Given a number s in their binary representation. Return the number of steps to reduce it to 1 under the following rules: If the current number is even, you …
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path …
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome …
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? We can start prime number 2 and …
Given a string s and an integer k. You should construct k non-empty palindrome strings using all the characters in s. Return True if you can use all the …
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, …