Category Archives: hackerrank

HackerRank : Week of Code 33 – Transform to Palindrome

Transform to Palindrome: Hackerrank The Orion alphabet system consists of letters, denoted by the integers from to . The Orion letter is denoted by the integer . Some Orion letters can be transformed to other Orion letters. A transformation is denoted by a pair of two Orion letters, . Using this transformation, you can replace letter with letter… Read More »

HackerRank : Week of Code 33 – Pattern Count

Pattern Count: Hackerrank A string s contains many patterns of the form 1(0+)1 where (0+) represents any non-empty consecutive sequence of 0 ‘s. The patterns are allowed to overlap. For example, consider string “1101001”, we can see there are two consecutive sequences “1(0)1” and “1(00)1” which are of the form  1(0+)1. You have to answer q queries, each containing a string s. For… Read More »

HackerRank : Ad Infinitum18 – Minimum Height Triangle

Minimum Height Triangle: Hackerrank Given integers b and  a, find the smallest integer h , such that there exists a triangle of height  h, base  b, having an area of at least  a. Input Format In the first and only line, there are two space-separated integers b and a , denoting respectively the base of a triangle and the desired minimum area.… Read More »

HackerRank : Week of Code 32 – Fight the Monsters

Fight the Monsters : Hackerrank Fight the Monsters – Jason is trapped in a forest with hungry monsters and must use his trusty blaster to defend himself! Each monster has a health value, . Jason can discharge his blaster at a monster once per second and reduce its health points by units. Once a monster’s health points become… Read More »