Skip to content

Instantly share code, notes, and snippets.

@AppleCEO
Created January 7, 2020 13:52
func solution(_ s:String) -> String {
var uppercaseToggle = true
return String(s.map { (character) -> Character in
if uppercaseToggle && character != " " {
uppercaseToggle = false
return Character(character.uppercased())
}
uppercaseToggle = true
return Character(character.lowercased())
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment