Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/bin/env raku
  2. my %hash =
  3. (
  4. '40:A_B' => 1,
  5. '22:jfdks' => 1,
  6. '3:fjdksf' => 1,
  7. '8:Q_Z' => 1,
  8. '2:interview' => 1
  9. );
  10.  
  11. for %hash.keys -> $k {
  12. say 'k: ',$k;
  13. }
  14. say '---------- Sorted ---------------';
  15. for %hash.keys.sort({$^a.split(':').head.Int <=> $^b.split(':').head.Int}) -> $k {
  16. say 'k: ', $k;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement