Python program for Jump game II
Improving the first solution

I like the first solution better, because I find it easier to understand how it works, and it's shorter.

It can be a bit simpler. The condition if i &lt;= curr_far: is unnecessary and can be safely dropped.

Instead of iterating over a range of indexes, I nice trick is to use enumerate, like this:

for index, value in enumerate(nums):


This way, instead of nums[index] in the loop body, you can use value directly.

Another code smell is the condition if i == curr_far and curr_far != 0 executed in every iteration of the loop, even though curr_far != 0 will only be false for the first iteration, otherwise always true.

I didn't like most of the variable names...


Instead of step, I would find jumps more natural
Instead of curr_far and next_far, I would find reach and next_reach more intuitive


All in all, I would write like this instead:

class Solution(object):
    def jump(self, nums):
        end = len(nums) - 1
        if not end:
            return 0

        reach = 0
        next_reach = 0
        jumps = 0
        for pos, value in enumerate(nums):
            if next_reach &lt; pos + value:
                next_reach = pos + value
                if next_reach &gt;= end:
                    return jumps + 1

            if pos == reach:
                reach = next_reach
                jumps += 1


Issues with the second solution


Looks more complex than the first, and I think unnecessarily so
The __init__ method is completely unnecessary
The outer parentheses are unnecessary in while(curr &lt; len(nums)):
The convention for the naming style of variables in Python is snake_case instead of camelCase