text. Return the smallest number of passes that is enough to do this.text='abba' → 2
First the roller covers the whole tape with a, giving aaaa, then a second pass prints bb in the middle.
text='tattoo' → 3
For example: tttt over the first four places, then a at the second place and oo at the end, three passes in total. You cannot do better: the word has three different letters, and each needs at least one pass.
text.length ≤ 200text consists of lowercase English letters onlytext='abba'
2
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.