Skip to main content
deleted 33 characters in body
Source Link
nwellnhof
  • 10.6k
  • 1
  • 20
  • 38

Perl 6, 2525 24 bytes

{[>] .map:{$_+^7*(8>$_(8 X>$_)}X*7)Z+^$_} 

Try it online!Try it online!

Takes a list of integers.

Explanation

{  } # Anonymous block .map:{ ( })Z+^$_ # MapXOR input values $_+^  # XOR with   (8 X>$_)X*7 7*(8>$_) # 7 if value < 8, reversing sort order   # 0 otherwise, keeping value unchanged [>] # All values strictly decreasing? 

Perl 6, 25 bytes

{[>] .map:{$_+^7*(8>$_)}} 

Try it online!

Takes a list of integers.

Explanation

{  } # Anonymous block .map:{  } # Map input values $_+^  # XOR with   7*(8>$_) # 7 if value < 8, reversing sort order   # 0 otherwise, keeping value unchanged [>] # All values strictly decreasing? 

Perl 6, 25 24 bytes

{[>] ((8 X>$_)X*7)Z+^$_} 

Try it online!

Takes a list of integers.

Explanation

{ } # Anonymous block ( )Z+^$_ # XOR input values with (8 X>$_)X*7 # 7 if value < 8, reversing sort order # 0 otherwise, keeping value unchanged [>] # All values strictly decreasing? 
Source Link
nwellnhof
  • 10.6k
  • 1
  • 20
  • 38

Perl 6, 25 bytes

{[>] .map:{$_+^7*(8>$_)}} 

Try it online!

Takes a list of integers.

Explanation

{ } # Anonymous block .map:{ } # Map input values $_+^ # XOR with 7*(8>$_) # 7 if value < 8, reversing sort order # 0 otherwise, keeping value unchanged [>] # All values strictly decreasing?