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
/* | |
Challenge: Write a function that checks if all the zeros of an array are at the | |
end (an array with no zeros in it does have all its zeros at the end). An empty | |
array also has all its zeros at the end. | |
The function should run in O(n) time, and it's okay if it always runs in O(n). | |
The objective here is "elegance" (ease of reading the code), not | |
performance. | |
Inspired by this real world Ruby discussion: |
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
# add the following somewhere your shell will source .bash_profile, .bashrc, .zshrc, etc. | |
export NPM_TOKEN=$(cat ~/.npmrc | sed 's/.*authToken=\(.*\)/\1/') |