2017-11-18
#HackerRank
#Solution
#Java Solution Sort the array of numbers Find the minimum difference between ith and (i+K-1)th element in each iteration.
2017-11-18
#HackerRank
#Solution
#Java Solution Iterate the sides in descending order Check if sides make a triangle by checking if sum of two sides is greater than third side .
2017-11-09
#HackerRank
#Solution
#Java Solution #1 Keep indexes of all numbers in a HashMap. Check if current maximum number is already at desired index i.
2017-11-08
#HackerRank
#Solution
#Java Solution Iterate through each house in a sorted order. Check if current house is in range of last transmitter.
2017-11-08
#HackerRank
#Solution
#Java Solution #1 Keep prices and corresponding index in a HashMap. Sort the prices array in ascending order so that combination of minimum difference can be found by comparing adjacent prices.
2017-11-08
#HackerRank
#Solution
#Java Solution Start iterating numbers from b to a because combination of larger numbers are more likely to be indivisible.
2017-11-07
#HackerRank
#Solution
#Java Solution Iterate from 2 to the given number. Consider odd numbers only except 2.
2017-11-07
#HackerRank
#Solution
#Java Solution Iterate from 1 to given number. Add each iteration to sum and square of it to another sum.
2017-11-06
#HackerRank
#Solution
#Java Solution Iterate from the given number to zero. Check if current iteration is a palindrome by using reverse() of StringBuilder class.
2017-11-06
#HackerRank
#Solution
#Java Solution Find all the factors of the given number by iterating from 1 to square root of the number.