Roy wants to change his profile picture on Facebook. Now Facebook has some restriction over the dimension of Roy’s Picture that we can upload. It is a problem of . Minimum dimension of the picture can be L x L, WHERE L is the length of the side of square. Now Roy has N photos of various dimensions. Dimension of a photo is denoted as W x H where W – width of the photo AND H – Height of the …

Home » Competitive » Hackerearth

# Category: Hackerearth

You have been given a String S consisting of uppercase and lowercase English alphabets. You need to change the case of each alphabet in this String. That is, all the uppercase letters should be converted to lowercase and all the lowercase letters should be converted to uppercase. That is Toggle String. You need to then print the resultant String to output. Input Format Of Toggle String The first and only line of input contains the String S Output Format Print …

Cricket Rating In computer science, the maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. India is a cricket crazy nation. Chang also loves cricket and computations related to cricket. Chang has created a Cricket app.This app analyses the performance of a cricketer. If a cricketer under-performs, then a negative rating is awarded. If performance is good, then positive rating is awarded to the cricketer.Chang wants to …

Print coderinme As a beginner to the programming, Sana came to Coderinme platform, to become a better programmer. She solved some problems and felt very confident. Later being a fan of Coderinme, she gave a problem to her friends to solve. They will be given a string containing only lower case characters (a-z), and they need to find that by using the characters of the given string, how many times they can print “Coderinme”(without quotes). As they are new to …

The great kian `Hackerearth` The great Kian is looking for a smart prime minister. He’s looking for a guy who can solve the OLP (Old Legendary Problem). OLP is an old problem (obviously) that no one was able to solve it yet (like P=NP). But still, you want to be the prime minister really bad. So here’s the problem: Given the sequence a1, a2, …, an find the three values a1 + a4 + a7 + …, a2 + a5 …

Debt of Lannister Lannister’s Debt Tyrion Lannister wants to pay Bronn reward for his services. Being a Lannister, he has an unlimited number of coins of denominations A, and B. He has also got an unlimited number of bags, in which he can give the money. Each bag can contain at most N rupees. Tyrion wants to pay Bronn at least M rupees. As you know, Tyrion cannot lift many bags, so he wants to minimise the number of bags. …

Nice Arches Hackerearth Nikki’s latest work is writing a story of letters. However, she finds writing story so boring that, after working for three hours, she realized that all she has written are M long words consisting entirely of letters A and B. Having accepted that she will never finish the story in time, poor Nikki has decided to at least have some fun with it by counting bubbly words. Now Nikki is connecting pairs of identical letters (A with …