Queen’s Attack 2 HackerRank Solution in C, C++, Java, Python
You will be given a square chess board with one queen and a number of obstacles placed on it. Determine how many squares the queen can attack. A queen is …
You will be given a square chess board with one queen and a number of obstacles placed on it. Determine how many squares the queen can attack. A queen is …
There is a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. The player can jump on any cumulus cloud …
There is a string,s, of lowercase English letters that is repeated infinitely many times. Given an integer,n , find and print the number of letter a’s in the first n …
Given a set of distinct integers, print the size of a maximal subset of where the sum of any numbers in is not evenly divisible by . For example, the …
You are given a number of sticks of varying lengths. You will iteratively cut the sticks into smaller sticks, discarding the shortest pieces until there are none left. At each …
Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any). The fee structure is …
Watson likes to challenge Sherlock’s math ability. He will provide a starting and ending value that describe a range of integers, inclusive of the endpoints. Sherlock must determine the number …
You have two strings of lowercase English letters. You can perform two types of operations on the first string: Append a lowercase English letter to the end of the string. …
The factorial of the integer n, written n!, is defined as: Calculate and print the factorial of a given integer. For example, if n=30, we calculate 30*29*28*….*2*1 and get . …
An integer d is a divisor of an integer n if the remainder of n/d=0. Given an integer, for each digit that makes up the integer determine whether it is …