Created
October 31, 2019 11:21
-
-
Save imedadel/56b0fcfe26f09ab2eda7b8187af9310f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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