Increase the visit count of the left and right cells within the array which can be visited
for j in range ( max ( 0 , i - ord ( str [ i ] ) , min ( length , i + ord ( str [ i ] ) ) + 1 ) ) : NEW_LINE INDENT visited [ j ] += 1 NEW_LINE DEDENT