Position

Write a function @pos_a(s, k)@ that takes a string ss and a non-negative integer kk and returns the position where the kk-th letter a occurs within ss, or -1 if the string ss contains fewer than kk letters a.

Sample session

Problem information

Author: InfBesos

Generation: 2026-01-25T14:51:48.157Z

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