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-05-21T12:05:48.716Z

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