Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
schoen
on Jan 26, 2017
|
parent
|
context
|
favorite
| on:
Show HN: Command Line Challenge
I didn't think we were allowed to even potentially change the order, so I used
awk '{if (!c[$0]) { print }; c[$0] = 1 }'
rando832
on Jan 27, 2017
|
next
[–]
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
on Jan 27, 2017
|
prev
[–]
awk '!a[$0]++' faces.txt
is a touch shorter ^^
schoen
on Jan 28, 2017
|
parent
[–]
That's the same approach used by the challenge's original creator (in the GitHub link above). It's a clever solution!
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: