Repeated String Java Coding Challenge | HackerRank | Edabit | How’d You Code That?

Published: 11 July 2020
on channel: Ed Clark
582
7

Repeated String on HackerRank: https://www.hackerrank.com/challenges...

Repeated String on Edabit: https://edabit.com/challenge/Sk3DXY6Z...

The problem statement for this challenge describes a string that should be repeated until it contains “n” number of characters. For example, If the string is “a-b-c-a-c” and “n” equals 10, by appending the string to itself exactly 1 time, we have a 10-character string. We then need to determine how many “a’s” exist within the 10-character string. In the given example, there are a total of 4 a’s found in the string.

In some cases, the given string and the required number of characters may result in truncation during the append process. For example, if our string is “a-b-a”, and “n” equals 10, we can append the string to itself 2 times, which results a 9-character string. We then need to append only the first character of the string, to result in a 10-character string. Or, if our string were 4 characters, “a-b-a-b”, for example, and “n” equals 10, we could append the string to itself 1 time, resulting in a 8-character string, which would then require the first 2 characters of the string to be appended to result in a 10-character string.

Closed Captions/Subtitles - [email protected]

Video Editing - [email protected]

Song: Fresh - Ikson (Vlog No Copyright Music)
Music promoted by Vlog No Copyright Music.
  / ikson  


Watch video Repeated String Java Coding Challenge | HackerRank | Edabit | How’d You Code That? online without registration, duration hours minute second in high quality. This video was added by user Ed Clark 11 July 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 582 once and liked it 7 people.