Couple of years ago when me and my friends appeared for campus interviews in IITs, NITs and BITs we faced many challenging interview questions like N petrol bunks arranged in a city, Sort Stack … Read More
Hacker Earth Questions
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
Find the smallest window in a string containing all characters of another string
Given two strings string1 and string2, find the smallest substring in string1 containing all characters of string2 efficiently.For Example:
Input string1: “this is a test string”
Input string2: “tist”
Output string: “t stri”
Longest Increasing Subsequence
The longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order.For example, length of LIS
… Read More HackeEarth Flipkart’s Drone
HackeEarth Flipkart’s Drone : After listening to the news of testing of Delivery Drone
But this was only possible if two of the shipping addresses had “V1-type” road connecting them(V1-type roads are the fastest in
… Read More But this was only possible if two of the shipping addresses had “V1-type” road connecting them(V1-type roads are the fastest in
Password Predictor
Danny has a possible list of passwords of Manny’s facebook account. All passwords length is odd. But Danny knows that Manny is a big fan of palindromes. So, his password and reverse of his password
… Read More Find an index i such that Arr [i] = i in array of n distinct integers sorted in ascending order.
Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array such that Arr[i] = i .
If there is any Fixed Point present
… Read More If there is any Fixed Point present
N Petrol bunks or City arranged in circle. You have Fuel and distance between petrol bunks. Is it possible to find starting point so that we can travel all Petrol Bunks
Find the first circular tour that visits all petrol pumps
There are n petrol bunks arranged in circle. Each bunk is separated from the rest by a certain distance. You choose some mode of travel
Rectangular chocolate bar Create at least one piece which consists of exactly nTiles tiles
Rectangular chocolate bar Create at least one piece which consists of exactly nTiles tiles.
You have a rectangular chocolate bar that consists of width x height square tiles. You can split it into two rectangular … Read More
Given a string, find the first character which is non-repetitive
Given a string, find the first character which is non -repetitive i.e that character must not be present anywhere else in the string.
With two different solutions.
Eg : Input : teeterson Output : r,