Campbell Ritchie wrote:But what happens if they are offered cash and refuse it?
Carey Brown wrote:
Gnanagowthaman sankar wrote:maxMirror([1, 2, 1, 4]) → 3 How 3 elements here 121 or 214 or 412 is not in sequence but how 3 elements
1, 2, 1 backwards is 1, 2, 1 and the array has that. It just happens to be the same sub-array.
S Fox wrote:He will get an NPE if he does what I think you are suggesting fred, then he might be able to read the stack trace to see exactly where his algorithm is broken. Right now he has the worst kind of error, a logic error.