Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
TopCoder SRM 646 Div2
# SRM 646 Div2 Easy
class TheConsecutiveIntegersDivTwo():
def find(self, numbers, k):
if k == 1:
return 0
else:
n_sorted = sorted(numbers)
n_diff = [n_sorted[i+1] - n_sorted[i] for i in range(len(numbers)-1)]
return min(n_diff) - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment