In the Matrix (a universe the humanity is unknowingly trapped inside, a simulated reality where intelligent machines have been created to distract humans while using their bodies as an energy source), we need only two types of pills: red or blue to select our destiny. Neo must select his to find the path. You have a list of pills of different colour, and you must filter out only the red and blue ones and help Neo to solve his dilemma.
Filtering elements in collection
Red pill and blue pill
Report a typo
Sample Input 1:
blue red orange blackSample Output 1:
[blue, red]Write a program in Kotlin
fun main() {
val list = readln().split(" ")
// write your code here
val res =
println(res)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.