Fibonacci Hashing : How do we find out what this Fibonacci Hashing is?
In real world Fibonacci hashing is not implemented or used even a part of it, because it’s actually more (Time and Space) … Read More
Mathematical
FizzBuzz Solution C C++
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples … Read More
Convert Decimal to Roman numbers / Romanizer HackerEarth Code
Set of Numbers are given to you.
convert them to Roman numbers.
Solution is in Hacker Earth style… Read More
‘N’ Story Building, with 1,2,3 steps how many ways can a person reach top of building.
A building has n steps. A person can take 1,2 or 3 steps. In how many ways can a person reach top of building.
In order to build logic, lets think from first step
If … Read More
The Magic HackerEarth Nirvana solutions Hiring Challenge
Navi got a task at school to collect N stones. Each day he can collect only one stone. As N can be a very large number so it could take many days to complete the
Count Possible Decodings of a given Digit Sequence
Find number of ways a string can be decoded into, if A=1, B=2, C=3 … Z=25 and encoding number is 123 ways decoding can be done is
1 2 3 = A B C
1
… Read More 1 2 3 = A B C
1
Find the number ABCD such that when multipled by 4 gives DCBA.
We need to find a number ABCD such that, 4(ABCD) = DCBA
These problems can be tricky and/or tedious, but this one isn’t too bad.Method 1 ) Forming Equations and Solving them
… Read More These problems can be tricky and/or tedious, but this one isn’t too bad.Method 1 ) Forming Equations and Solving them
Puzzle : 100 doors in a row Visit and Toggle the door. What state the door will be after nth pass ?
you have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and
… Read More Possible sizes of bus to carry n groups of friends
There are n groups of friends, and each group is numbered from 1 to n. The ith group contains ai people.
They live near a bus stop, and only a single bus operates on this
Find if two rectangles overlap
Given two rectangles, find if the given two rectangles overlap or not.
… Read More Note that a rectangle can be represented by two coordinates, top left and bottom right. So mainly we are given following four coordinates.