Recursion-1 > countPairs
prev | next | chance
We'll say that a "pair" in a string is two instances of a char separated by a char. So "AxA" the A's make a pair. Pair's can overlap, so "AxAxA" contains 3 pairs -- 2 for A and 1 for x. Recursively compute the number of pairs in the given string.
countPairs("axa") → 1
countPairs("axax") → 2
countPairs("axbx") → 1
|Turning python script into an applet||12||99|
|Why does the Android Studio logcat show this error when the user presses the button?||2||41|
|split string containing \r\n in Java||46||38|
|Spring Framework HTTPSession management||1||21|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!