Ice Cream Parlor Hacker Rank Problem Solution. Sunny and Johnny together have MM dollars they want to spend on ice cream. The parlor offers NN flavors, and they want to choose two flavors so that they end up spending the whole amount. You are given the cost of these flavors. The cost of the iithth flavor is denoted by ccii. You have… Continue reading Ice Cream Parlor Hacker Rank Problem Solution
Short Description : Observe that its base and height are both equal to n , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase of size n . Problem statement is Here : StairCase Solution : Click here to copy
Hackerland is a one-dimensional city with houses, where each house i is located at some xi on the x-axis. The Mayor wants to install radio transmitters on the roofs of the city's houses. Each transmitter has a range,k , meaning it can transmit a signal to all houses <=k units of distance away.
Given a square matrix of size NxN, calculate the absolute difference between the sums of its diagonals. Input Format The first line contains a single integer, N . The next N lines denote the matrix's rows, with each line containing N space-separated integers describing the columns.
A left rotation operation on an array of size shifts each of the array's elements unit to the left. For example, if left rotations are performed on array[1,2,3,4,5] , then the array would become [3,4,5,1,2] .