The problem is as follows: Given an array, which represents the levels in Mario Game, determine whether mario can complete the level or not. Mario can only take 1 jump and the jump can be of maximum height 2. He can also jump directly by avoiding pits. He can jump down from any height.

For example, array is [0,1,-1,1,2,3,0]: So, Mario starts from 0th level, jumps to 1, further jumps to 1 again by avoiding pit (represented by -1), Jumps to 2 (it is allowed since he can jump maximum height 2 levels from current height), jumps to 3 and jumps down to 0 and thus clears the level.

However, if array is: [0,3,0]: Then mario cannot complete the level (return False) If array is: [1,-1,1]: Mario can complete the level by directly jumping to 1 and avoiding the pit.

One more important case is: [1,2,3,4,1,4,0]: Mario should jump from 1 to 2 to 3 to 4. But from here, he should not jump down to 1 as he cannot climb back up to 4. Instead he should directly jump from 4 to 4 and then jump down to 0.

How can you solve this efficiently?