Accepted code for TheRepeater both large and small test cases