Question: complete codingbat question: For each character 'a' that you see in a string, add 1, and then return the sum. getNumberOfAs(string) 0 getNumberOfAs(aadrvark) 3 getNumberOfAs(amy)
complete codingbat question:
| For each character 'a' that you see in a string, add 1, and then return the sum. getNumberOfAs("string") 0 getNumberOfAs("aadrvark") 3 getNumberOfAs("amy") 1
given code: public int getNumberOfAs(String str) { } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
