Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
schoen
· 9y ago · 0 comments
I didn't think we were allowed to even potentially change the order, so I used
awk '{if (!c[$0]) { print }; c[$0] = 1 }'
Comments
[–]
rando832
9y ago
Oh ya, I shouldn't have said answer, because uniq is not a way to the answer, just something I naturally reached for while trying to figure out an answer.
[–]
_druu
9y ago
awk '!a[$0]++' faces.txt
is a touch shorter ^^
[–]
schoen
OP
9y ago
That's the same approach used by the challenge's original creator (in the GitHub link above). It's a clever solution!