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)”

Origin containing triangle

Overview In this article we will try to solve a problem mention in the Perl Weekly Challenge called Origin-containing triangle. We are given the coordinates of the triangle A(x1, y1), B(x2, y2) and C(x3, y3). We need to find whether the origin O(0, 0) lies between the triangle. Solution What we need to do isContinue reading “Origin containing triangle”

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”

Minimum Triangle Sum – Java/Kotlin

Overview In this article we will try to solve one of the problem mentioned in Perl Weekly Challenge in Java. The problem is called Triangle Sum. You are given triangle array. You need to find the minimum path sum from top to bottom. When you are on index i on the current row then youContinue reading “Minimum Triangle Sum – Java/Kotlin”

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”