Last active
November 17, 2022 22:29
-
-
Save konverner/df7856b6161c7f295d2d6cda8259f714 to your computer and use it in GitHub Desktop.
one line mode in python
This file contains 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
arr = [2, 2, 1, 1, 1, -1, -1, 0] | |
sorted([(i,arr.count(i)) for i in set(arr)], key=lambda x: x[1], reverse=True)[0][0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment