Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2020

Hackerrank - Pairs Solution

You will be given an array of integers and a target value. Determine the number of pairs of array elements that have a difference equal to a target value. For example, given an array of [1, 2, 3, 4] and a target value…

2020

Hackerrank - Minimum Loss Solution

Lauren has a chart of distinct projected prices for a house over the next several years. She must buy the house in one year and sell it in another, and she must do so at a loss. She wants to minimize her financial loss…

2020

Hackerrank - The Time in Words Solution

Given the time in numerals we may convert it into words, as shown below: At , use o' clock. For , use past, and for use to. Note the space between the apostrophe and clock in o' clock. Write a program which prints the…

2020

Hackerrank - Two Characters Solution

In this challenge, you will be given a string. You must remove characters until the string is made up of any two alternating characters. When you choose a character to remove, all instances of that character must be…

2020

Hackerrank - Flipping bits Solution

You will be given a list of 32 bit unsigned integers. Flip all the bits ( and ) and print the result as an unsigned integer. For example, your decimal input . We're working with 32 bits, so: Function Description…

2020

Hackerrank - Mark and Toys Solution

Mark and Jane are very happy after having their first child. Their son loves toys, so Mark wants to buy some. There are a number of different toys lying in front of him, tagged with their prices. Mark has only a certain…

2020

Hackerrank - Luck Balance Solution

Lena is preparing for an important coding competition that is preceded by a number of sequential preliminary contests. Initially, her luck balance is 0. She believes in "saving luck", and wants to check her theory. Each…

2020

Hackerrank - Grid Challenge Solution

Given a square grid of characters in the range ascii[a-z], rearrange elements of each row alphabetically, ascending. Determine if the columns are also in ascending alphabetical order, top to bottom. Return YES if they…

2020

Hackerrank - Marc's Cakewalk Solution

Marc loves cupcakes, but he also likes to stay fit. Each cupcake has a calorie count, and Marc can walk a distance to expend those calories. If Marc has eaten cupcakes so far, after eating a cupcake with calories he…

2020

Hackerrank - Two Strings Solution

Given two strings, determine if they share a common substring. A substring may be as small as one character. For example, the words "a", "and", "art" share the common substring . The words "be" and "cat" do not share a…

2020

Hackerrank - Making Anagrams Solution

We consider two strings to be anagrams of each other if the first string's letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact…

2020

Hackerrank - Anagram Solution

Two words are anagrams of one another if their letters can be rearranged to form the other word. In this challenge, you will be given a string. You must split it into two contiguous substrings, then determine the…

2020

Hackerrank - Palindrome Index Solution

Given a string of lowercase letters in the range ascii[a-z], determine a character that can be removed to make the string a palindrome. There may be more than one solution, but any will do. For example, if your string…

ESC