Skip to main content
-3 bytes thanks to Kevin Cruijssen
Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

Java (JDK 10), 126123 bytes

l->l.sort(java.util.Comparator.comparing(n->{var r="";for(var c:(""+n).charssplit("").mapToObj(c->10+"854)r+=11+"54-9176320".indexOf(c)+"").reduce("",(a,b)->a+b);return r;}))

Try it online!Try it online!

This is a naive Java implementation. Should be much golfable.

Credits

Java (JDK 10), 126 bytes

l->l.sort(java.util.Comparator.comparing(n->(""+n).chars().mapToObj(c->10+"854-9176320".indexOf(c)+"").reduce("",(a,b)->a+b)))

Try it online!

This is a naive Java implementation. Should be much golfable.

Java (JDK 10), 123 bytes

l->l.sort(java.util.Comparator.comparing(n->{var r="";for(var c:(""+n).split(""))r+=11+"54-9176320".indexOf(c);return r;}))

Try it online!

This is a naive Java implementation. Should be much golfable.

Credits

Source Link
Olivier Grégoire
  • 14.4k
  • 3
  • 32
  • 56

Java (JDK 10), 126 bytes

l->l.sort(java.util.Comparator.comparing(n->(""+n).chars().mapToObj(c->10+"854-9176320".indexOf(c)+"").reduce("",(a,b)->a+b)))

Try it online!

This is a naive Java implementation. Should be much golfable.