Created
October 6, 2022 11:56
-
-
Save Nasah-Kuma/28266553978bb39e0d6b863299e29bd1 to your computer and use it in GitHub Desktop.
Solution to HackerRank's CamelCase: https://www.hackerrank.com/challenges/camelcase/problem?isFullScreen=true
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
function camelcase(s) { | |
// Write your code here | |
let wordCount = 1; | |
let i = 0; | |
while (i < s.length) { | |
if(s[i].toUpperCase() === s[i]) wordCount++; | |
i++; | |
} | |
return wordCount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment