You are viewing a single comment's thread. Return to all comments →
for(char c : s.toCharArray()) if(c == 'a') count++;
Instead of allocating space for a charArray you could just do s.charAt(i) like you did below.
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
Instead of allocating space for a charArray you could just do s.charAt(i) like you did below.