Counting a’s (3)

Write a function @count_a(s, stop)@ that given a string @s@ and a
character @stop@ returns the number of times that letter @a@ occurs in
@s@ before the first appearance of character @stop@. If character @stop@
is not in @s@, the function must return −1.

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T16:56:21.451Z

© Jutge.org, 2006–2026.
https://jutge.org
