The Swift version uses the default variable name "tape" for the user input string. This is potentially confusing. I would recommend that this be changed to "input" to match the implementation in other languages.
Good catch! Just using size % 2 == 1 would work.
size % 2 == 1
Loading collection data...
The Swift version uses the default variable name "tape" for the user input string. This is potentially confusing. I would recommend that this be changed to "input" to match the implementation in other languages.
Good catch! Just using
size % 2 == 1
would work.