Tag Archives: Migratory Birds

HackerRank : RookieRank 2 – HackerRank in a String!

HackerRank in a String! Source : Hackerrank We say that a string, , contains the word hackerrank if a subsequence of the characters in spell the word hackerrank. For example, haacckkerrannkk does contain hackerrank, but haacckkerannk does not (the characters all appear in the same order, but it’s missing a second r). More formally, let be the respective… Read More »

HackerRank : RookieRank 2 – Minimum Absolute Difference in an Array

Minimum Absolute Difference in an Array Source : Hackerrank Consider an array of integers, . We define the absolute difference between two elements, and (where ), to be the absolute value of . Given an array of n integers, find and print the minimum absolute difference between any two elements in the array. Input Format The first line contains… Read More »

HackerRank : RookieRank 2 – Migratory Birds

Migratory Birds Source : Hackerrank A flock of n birds is flying across the continent. Each bird has a type, and the different types are designated by the ID numbers 1,2 ,3 ,4 , and 5 . Given an array of n integers where each integer describes the type of a bird in the flock, find and print the type number of the most… Read More »