Minute to Win It

here is the problem statement link

https://www.hackerrank.com/contests/w38/challenges/minute-to-win-it

and my code is
n, k = return map(int, raw_input().split())
arr = return map(int, raw_input().split())
cnt = 0
if n < 2:
print "0"
else:
for i in xrange(1,n):
if arr[i] - arr[i-1] == k:
continue
else:
arr[i] = arr[i-1] + k
cnt += 1
print cnt
You have the same problem in logic as in: http://www.cplusplus.com/forum/beginner/238498/
1) Your link doesn't work.

2) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

3) This isn't C++. It looks like Python to me. Why are you posting Python code in a C++ forum?
Topic archived. No new replies allowed.