Electronic Shop (Hacker Rank)

Overview In this article we will try to solve one of the problem from HackerRank called Electronic Shop. A person wants to determine the most expensive computer keyboard and USB drive that can be purchased with a give budget. Given price lists for keyboards and USB drives and a budget, find the cost to buyContinue reading “Electronic Shop (Hacker Rank)”

HackerRank – Making Anagrams

Overview In this article we will see how to solve the Making Anagrams problem mentioned in Hacker rank. A student is taking a cryptography class and has found anagrams to be very useful. Two strings are anagrams of each other if the first string’s letters can be rearranged to form the second string. In otherContinue reading “HackerRank – Making Anagrams”

Hacker Rank – Apple and Orange

Overview In this article we will try to solve one of the problem from Hacker Rank. It’s called Apple and Orange. Sam’s house has an apple tree and an orange tree that yield an abundance of fruit. Using the information given below, determine the number of apples and oranges that land on Sam’s house. sContinue reading “Hacker Rank – Apple and Orange”

Hacker Rank – Time Conversion – Java/Kotlin

Overview In this article we will try to solve the Time Conversion problem mentioned in Hacker Rank. Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. Example Code First get the values of hours, minutes and seconds: Now we need to check whether it’s AM or PM time because the conversionContinue reading “Hacker Rank – Time Conversion – Java/Kotlin”

Minimum absolute difference in an array

Overview In this article we will try to solve on the the problem described in Hacker Rank. The name of the problem is Minimum absolute difference in an array The absolute difference is the positive difference between two values a and b, is written |a – b| or |b – a| and they are equal.Continue reading “Minimum absolute difference in an array”