## Self Descriptive Numbers

Overview In this article we will write a program to find if the given number is a Self Descriptive Number or not. In mathematics, a self-descriptive number is an integer m that in a given base b is b digits long in which each digit d at position n (the most significant digit being atContinue reading “Self Descriptive Numbers”

## Between Two Sets

Overview In this article we will try to solve one of the problem mentioned in Hacker Rank. The name of the problem is Between Two Sets. There will be two arrays of integers. Determine all integers that satisfy the following two conditions: The elements of the first array are all factors of the integer beingContinue reading “Between Two Sets”

## Flipping Bits

Overview In this article we will try to solve one of the problem from Hacker Rank. The problem is called Flipping Bits. You will be given a list of 32 bit unsigned integers. Flip all the bits (1 –> 0 and 0 –> 1) and return the result as an unsigned integer. Example n =Continue reading “Flipping Bits”

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

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