Created
April 22, 2021 22:19
-
-
Save naxmefy/37e29c84b15804ba95c47828375eeb0c to your computer and use it in GitHub Desktop.
sum all numerics in a sentence (string with spaces)
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
print(readline().match(/\d+/g).reduce((p,c)=>p+(+c),0)) |
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
p eval`dd`.scan(/\d+/)*?+ |
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
egrep -o [0-9]+|paste -sd+|bc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment