Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. {"abc123", "abc6", "abc47", "abd49"} -> {"abc6", "abc47", "abc123", "abd49"}
  2. {"foo0", "bar12", "foobar12", "foo"} -> { "bar12", "foo", "foo0", "foobar12"}
  3. {"Bond007", "Bond07", "Bond7", "Bond12"} -> {"Bond007", "Bond07", "Bond7", "Bond12"}
  4. {"one1", "one11two23", "one1two2", "one1two3", "1"} -> {"1", "one1", "one1two2", "one1two3", "one11two23"}
  5.  
  6. fØD$V$,$Þ
  7.  
  8. fØD$V$,$Þ Main Link
  9. Þ Sort with key:
  10. fØD Filter to keep only digits
  11. V Jelly-eval the result
  12. , Pair with original string (for tiebreak)
  13. $ $ $ (Link combiners, syntax thing)
  14.  
  15. ΣDþïs)}
  16.  
  17. ΣDþïs)} Full Program
  18. Σ } Sort by result of key: a
  19. D a, a
  20. þ digits_only(a), a
  21. ï int(digits_only(a)), a
  22. s a, int(digits_only(a))
  23. ) [a, int(digits_only(a))]
Add Comment
Please, Sign In to add comment