← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given an integer array arr of length n. You start at index 0 and must end at index n-1.
From index i, you may jump to:
Your score is the sum of arr values on all visited indices (including start and end).
Task: Return the maximum achievable score when reaching n-1. If n-1 is unreachable, return -1.