4월 18, 2019의 게시물 표시

HackerRank Java Repeated String

이미지
문제 풀기 :  https://www.hackerrank.com/challenges/repeated-string/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=warmup Lilah has a string,   , of lowercase English letters that she repeated infinitely many times. Given an integer,   , find and print the number of letter   a 's in the first     letters of Lilah's infinite string. For example, if the string     and   , the substring we consider is   , the first     characters of her infinite string. There are     occurrences of   a   in the substring.   Function Description Complete the   repeatedString   function in the editor below. It should return an integer representing the number of occurrences of   a   in the prefix of length     in the infinitely repeating string.   repeatedString has the following parameter(s):   s : a string to repeat ...