Given a integer N, find out how many trailing zeroes are there for it's factorial result - N!. Sample Input: 10! Sample Output: 2 The factorial of 10 is 3628800,…
Given a string containing brackets characters "(",")","[","]","{" and "}", find out whether it has balanced brackets or not. A string has balanced brackets if: Open brackets must be closed by…
Given a list of words, find out the longest common prefix among them. If there is no common prefix, return an empty string. Sample Input: integer, integrity, integrate, interim Sample…
Roman numerals are a numeral system that originated in ancient Rome and remained the usual way of writing numbers throughout Europe well into the Late Middle Ages. Numbers in this…
Given an unsigned integer, try to calculate its square root value without using the math.sqrt() function. Sample Input: 10 Sample Output: 3.162277660168379 The square root value for 10 is 3.162277660168379.…
Two binary trees are identical when they have same data and arrangement of data is also same. To identify if two trees are identical, we need to traverse both trees…
The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter. A Utopian Tree sapling with a height of 1 meter is planted at…
In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the…