Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isTandemRepeat(inputString)
- if inputString.length % 2 != 0 then
- return false
- end
- x = 0
- string_1 = ""
- string_2 = ""
- while (x < inputString.length / 2)
- string_1[x] = inputString[x]
- x = x + 1
- end
- x = inputString.length / 2
- y = 0
- while (x < inputString.length)
- string_2[y] = inputString[x]
- x = x + 1
- y = y + 1
- end
- if string_1 == string_2 then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment