Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def coolString(inputString)
- string_length = inputString.length
- x = 0
- if string_length == 1 then
- if (inputString[x] >= 'A' and inputString[x] <= 'Z') or (inputString[x] >= 'a' and inputString[x] <= 'z') then
- cool = true
- else
- return false
- end
- end
- if (inputString[string_length - 1] >= 'A' and inputString[string_length - 1] <= 'Z') or (inputString[string_length - 1] >= 'a' and inputString[string_length - 1] <= 'z') then
- cool = true
- else
- return false
- end
- while (x < string_length - 1)
- if (inputString[x] >= 'A' and inputString[x] <= 'Z') or (inputString[x] >= 'a' and inputString[x] <= 'z') then
- cool = true
- else
- return false
- end
- if inputString[x] != inputString[x + 1] then
- cool = true
- else
- return false
- end
- x = x + 1
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment