Created
March 10, 2020 14:35
-
-
Save ms314006/9af159b156963b71cb4ca6b4b39285b1 to your computer and use it in GitHub Desktop.
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
var plusOne = function(digits) { | |
// 總合 join => Number => String => split => map | |
return String((Number(digits.join('')) + 1)).split('').map(digit => Number(digit)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment