Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2020

HackerRank No Idea! Solution

There is an array of integers. There are also disjoint sets, and , each containing integers. You like all the integers in set and dislike all the integers in set . Your initial happiness is . For each integer in the…

Hackerrank1 min read
2020

HackerRank Word Order Solution

You are given words. Some words may repeat. For each word, output its number of occurrences. The output order should correspond with the input order of appearance of the word. See the sample input/output for…

Hackerrank1 min read
2020

HackerRank - Map and Lambda Function Solution

Let's learn some new Python concepts! You have to generate a list of the first N fibonacci numbers, 0 being the first number. Then, apply the map function and a lambda expression to cube each fibonacci number and print…

Hackerrank2 min read
2020

HackerRank - Merge the Tools! Solution

Consider the following: A string, s , of length n where s = c0c1...cn-1. An integer, k , where k is a factor of n. We can split s into n/k subsegments where each subsegment, ti , consists of a contiguous block of…

Hackerrank2 min read
2020

HackerRank - The Minion Game Solution

Kevin and Stuart want to play the 'The Minion Game'. Game Rules Both players are given the same string, S. Both players have to make substrings using the letters of the string S. Stuart has to make words starting with…

Hackerrank1 min read
2020

HackerRank - Capitalize! solution

You are asked to ensure that the first and last names of people begin with a capital letter in their passports. For example, alison heck should be capitalised correctly as Alison Heck.

Hackerrank1 min read
2020

HackerRank - Finding the percentage solution

You have a record of N students. Each record contains the student's name, and their percent marks in Maths, Physics and Chemistry. The marks can be floating values. The user enters some integer N followed by the names…

Hackerrank1 min read
2020

HackerRank Nested Lists Python solution

Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with…

Hackerrank3 min read
2020

HackerRank List Comprehensions solution in Python

Let's learn about list comprehensions! You are given three integers X, Y and Z representing the dimensions of a cuboid along with an integer N. You have to print a list of all possible coordinates given by (i,j,k) on a…

Hackerrank3 min read
2020

HackerRank Tuples Solution in Python

Task Given an integer, , and space-separated integers as input, create a tuple, , of those integers. Then compute and print the result of . Note: hash() is one of the functions in the __builtins__ module, so it need not…

Hackerrank1 min read
2020

Lists Command Solution

Consider a list (list = []). You can perform the following commands: insert i e: Insert integer at position . print: Print the list. remove e: Delete the first occurrence of integer . append e: Insert integer at the end…

Hackerrank1 min read
2020

Find the Runner-Up Score Solution

Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up. Input Format The first…

Hackerrank1 min read
2020

String Validator Solution

Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric characters, digits, etc. str.isalnum() This method checks if all the characters…

Hackerrank2 min read
ESC