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

Publié le: 11 juillet 2020
sur la chaîne: Ed Clark
604
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 - ed2clark@gmail.com

Video Editing - ed2clark@gmail.com

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


Sur cette page du site, vous pouvez voir la vidéo en ligne Repeated String Java Coding Challenge | HackerRank | Edabit | How’d You Code That? durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ed Clark 11 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 604 fois et il a aimé 7 téléspectateurs. Bon visionnage!