Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

There is a string, , of lowercase English letters that is repeated infinitely many times. Given an integer,n , find and print the number of letter a's in the first letters of the infinite string.

Example

The substring we consider is , the first characters of the infinite string. There are occurrences of a in the substring.

Function Description

Complete the repeatedString function in the editor below.

repeatedString has the following parameter(s):

s: a string to repeat n: the number of characters to consider Returns

int: the frequency of a in the substring