Simply return odd or even if you have a list and you need the first and only element of it.
You have two bugs in your code which can result in a crash, and they are 100% reproducible. Your solution should crash also when run in your local IDE. Does it?
This comment is hidden because it contains spoiler information about the solution
Read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#expected-the-same
Wow, thanks for this lovely kata. For myself it took me a while to realize how to do it...
When i saw the solutilon from others and looked and my solution i felt really weird, really took it from different point of view :D
What exactly is the problem? Do tests crash, or you see some red assertion messages about failed test cases?
What do you mean by " Is there any way to send array without scope in function"?
Same issue in swift 5.0. Is there any way to send array without scope in function :\ ?
Currently it's difficult to help because your solution is difficult to read. After you post it properly, someone could take a look.
While it's true compiler could and probably will be updated at some point, it seems using features not present in the currently available compiler is your problem, not a kata's problem.