Skip to content

Instantly share code, notes, and snippets.

@imedadel
Created October 31, 2019 11:21
Show Gist options
  • Select an option

  • Save imedadel/56b0fcfe26f09ab2eda7b8187af9310f to your computer and use it in GitHub Desktop.

Select an option

Save imedadel/56b0fcfe26f09ab2eda7b8187af9310f to your computer and use it in GitHub Desktop.
def pickingNumbers(arr):
maximum = 0
for number in arr:
freq = arr.count(number) + arr.count(number-1)
if freq > maximum:
maximum = freq
return maximum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment