Example of validate chain character repeated based of a parameter
Recently I had a interview job and practical test with a couple exercise, unfortunately I counld’t finish all the exercises in the time that I had, actually was only three exercise but I don’t know if is because I don’t code to much these days but I feel in due to finish this exercise for my own. I will post only the first two because the third one it was basically create a api with consuming a specifcs url that I don’t remember.
The first exercise requested a function with two parameters, one is a chain o characters or string and the second parameter a int number. Based of the second parameter, you should validate how many characters of the chain should be repeat. For example: