Company: Myntra hackerramp_5july

Difficulty: medium

Problem Statement

Bob is a wildlife photographer who is going for an N hour trekking trip. He decides to use one of his old favourite cameras for the trip. This camera's battery can last for X hours, but it switches off automatically one hour after being turned on, and cannot be turned off manually in between. The camera has limited storage capacity L , so Bob can click only ( L -1) number of pictures. He gets the information from the tour guide about the number of different animals he will be able to see in every hour of the trip. Write a program to help him maximise the number of animals P he will be able to click during the trip. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the standard output. Input Format: The first line of input contains three integers, N , X , and L separated by a single white space. The second line of input contains N integers separated by single white spaces, which deno

More Myntra hackerramp_5july OA questionsInterview experiences