Don't be a Java-ish dev in Kotlin-ish world, improve your knowledge about Koltin Standard Library and write better Kotlin code. ✌🏻 If your Java dev migrating to Kotlin this will help you learn alot!
The aim of these articles is not hate on Java, but to help people learn various ways in which they can write the same logic better and more Kotlin standard library focused way.
Find the imposter from the given array with at least 3 items, it's either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns this "Imposter" N...
imposter(arrayOf(2,6,8,-10,3)) => returns 3 imposter(arrayOf(206847684,1056521,7,17,1901,21104421,7,1,35521,1,7781)) => returns 206847684 imposter(arrayOf(Integer.MAX_VALUE, 0, 1))=> returns 0
Try it out yourself, or submit it in the comments before checking out my solutions.
Hope to see you on the other side...
Until next time. Happy Hacking! 👩💻