You are viewing a single comment's thread. Return to all comments →
Here is a python O(n) time and O(1) space:
def camelcase(s): if s == "": return 0 w_count = 1; for ch in s: if ch.isupper(): w_count += 1 return w_count
Seems like cookies are disabled on this browser, please enable them to open this website
CamelCase
You are viewing a single comment's thread. Return to all comments →
Here is a python O(n) time and O(1) space: