Last active
December 15, 2015 17:20
-
-
Save EdGuiness/5296102 to your computer and use it in GitHub Desktop.
playing with sort
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
| sub findRemainder { | |
| map {return $_[0] % ($_[1] || 1) } @_ = sort { $b <=> $a } @_; | |
| } | |
| print findRemainder(142,1000),"\n"; | |
| print findRemainder(1000,142),"\n"; | |
| print findRemainder(1000,0),"\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This won't work either. map() only takes one element at a time.
How about ordering your terms (not that I necessarily agree with your definition, but...)