Created
January 12, 2023 20:23
-
-
Save lexisother/85a527138f1ab719b93930602f3f7c7e to your computer and use it in GitHub Desktop.
Lisp solution for https://media.discordapp.net/attachments/824921608560181261/1063183982558191666/IMG_2133.png
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
(defun maxcount (nums) | |
(max (count-if (lambda (a) (< a 0)) nums) | |
(count-if (lambda (a) (> a 0)) nums))) | |
(print (maxcount '(1 2 3 4 5 6 -3 -5 7 -7))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment