def minJumps(self, arr, n):
    if (len(arr) == 1):
        return 1
    if (arr[0] == 0):
        return (- 1)
    jumps = 1
    reach = arr[0]
    steps = arr[0]
    for i in range(1, (n - 1)):
        reach = max(reach, (arr[i] + i))
        steps -= 1
        if (steps == 0):
            jumps += 1
            if (i >= reach):
                return (- 1)
            steps = (reach - i)
    return jumps
def minJumps(self, arr, n):
    if (len(arr) == 1):
        return 1
    if (arr[0] == 0):
        return (- 1)
    jumps = 1
    reach = arr[0]
    steps = arr[0]
    for i in range(1, (n - 1)):
        reach = max(reach, (arr[i] + i))
        steps -= 1
        if (steps == 0):
            jumps += 1
            if (i >= reach):
                return (- 1)
            steps = (reach - i)
    return jumps