Skip to content

Instantly share code, notes, and snippets.

View robotwholearned's full-sized avatar

Cassandra Sandquist robotwholearned

View GitHub Profile
history | awk '{CMD[$2]++;count++;}END { for (a in CMD) print CMD[a] " " CMD[a]/count*100 "% " a;}'
#or fully
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
/*Problem Definition
Imagine that you are a developer with the Lowe's iOS team.
The team has been tasked with launching a new product suggestion service.
The suggestion logic is based on the following rules:
• A customer should only be suggested to purchase a product that they have not bought themselves.
• A customer should only be suggested to purchase a product that their friends have purchased
• The suggestion order should be driven by how many friends have purchased the same item
•If multiple friends purchased the same item, it should be higher in the suggestions than a product that only one friend owns.