Tag: bruteforce algorithm
Problem statement: Given a cage that has R rabbits and C chicken, and we know there are H heads and L legs. So find out the value of R …
A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s. Return the longest happy prefix of …
Given a string S of digits, such as S = “123456579”, we can split it into a Fibonacci-like sequence . Formally, a Fibonacci-like sequence is a list F of …
Given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0. Consider a list of …
A googol (10100) is a massive number: one followed by one-hundred zeros; 100100 is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the …