consecutive elements diff

Solutions on MaxInterview for consecutive elements diff by the best coders in the world

showing results for - "consecutive elements diff"
Rowan
06 Aug 2020
1>>> t
2[1, 3, 6]
3>>> [j-i for i, j in zip(t[:-1], t[1:])]  # or use itertools.izip in py2k
4[2, 3]
5
similar questions
queries leading to this page
consecutive elements diff