These are the programms I have done in Hackerrank.
-
Plus Minus: Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with places after the decimal.
-
Min-Max Sum: Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.
-
Time Conversion: Given a time in -hour AM/PM format, convert it to military (24-hour) time.
-
Lonely Integer: Given an array of integers, find and print the lonely integer.
-
Diagonal Difference: Given a square matrix, calculate the absolute difference between the sums of its diagonals.
-
Counting Sort: You create an integer array whose index range covers the entire range of values in your array to sort. Each time a value occurs in the original array, you increment the counter at that index. At the end, run through your counting array, printing the value of each non-zero valued index that number of times.
-
ZigZag Conversion: Given an array of distinct integers, transform the array into a zig zag sequence by permuting the array elements. A sequence will be called a zig zag sequence if the first elements in the sequence are in increasing order and the last elements are in decreasing order, where . You need to find the lexicographically smallest zig zag sequence of the given array.
-
Tower Breakers: Two players are playing a game of Tower Breakers! Player always moves first, and both players always play optimally
-
Caesar Cipher: Julius Caesar protected his confidential information by encrypting it using a cipher. Caesar's cipher shifts each letter by a number of letters. If the shift takes you past the end of the alphabet, just rotate back to the front of the alphabet. In the case of a rotation by 3, w, x, y and z would map to z, a, b and c.
-
Grid Challenge: 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 are or NO if they are not.