Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/bin/perl6
- my %hash, my $last, my $start = now;
- for $*IN.words -> $word {
- { %hash{$word}++; } if %hash{$word}:exists;
- { %hash{$word}++; } unless %hash{$word}:exists;
- $last = $word;
- }
- say "last number: $last, amount of times: %hash{$last}, exec time: {now - $start}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement