Category: java
Given two integers L and R, find the count of numbers in the range (inclusive) having a prime number of set bits in their binary representation. (Recall that the …
You have some sticks with positive integer lengths. You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + …
A Leap year occurs mostly every 4 years, but every 100 years, we skip a leap year, unless it is divisible by 400. Leap Year Algorithm if (year is …
The Singleton design is one of the must-known design pattern if you prepare for your technical interviews (Big IT companies have design questions apart from coding questions). The Singleton …
Given a binary tree, collect a tree’s nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example: Input: 1 / …