Panda Guru LogoPanda
Guru

OA question Amazon

Round 1

Questions: An array is given. For example:

[-2, 4, 3, -2, -1]

In one operation, you can delete one element and then add the elements which are present to the left and right of it. You can also delete elements that are present at index 0 and the last index.

For example, let's say I am removing -2 at index 3:

The final answer is 4.

So basically, repeat this operation until only one element is left. That would be your answer. Perform these operations in such a way that you get the maximum element as the answer.

Constraints:

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.