In the standard loopholes, the following is forbidden:
Claiming that your answer is written in "MyOwnLanguage", where the command
x
means "read a sequence of numbers, split them into groups of three, and print the last numbers of those groups where the second number is less than the first"
Here, we are going to do the exact same thing.
Task
Given a sequence of positive integers, whose length is divisible by 3, split them into groups of three, and print the last numbers of those groups where the second number is less than the first.
Testcases
Input Output
[] []
[1,2,3,4,5,6,7,8,9] []
[2,1,3,5,4,6,8,7,9] [3,6,9]
[3,1,4,1,5,9,2,6,5] [4]
[100,99,123] [123]
[123,123,456] []
[456,123,789] [789]
Scoring
This is code-golf. Shortest answer in bytes wins.
Standard loopholes apply, so remember not to have a built-in command x
that does this task.
MyOwnLanguage
and add thex
command... :P \$\endgroup\$x
specifically performing that function. \$\endgroup\$p
, can I use it? \$\endgroup\$