Re:LINQ Ruined My Favorite Interview Question
by recuter on Thursday July 11, 2013 @11:56AM
(#6026850)
In case anybody was wondering for a second when JS got so awesome -- it didn't, this is a snippet of Python. D'oh. Sigh.
[ Parent
| on HN ]
Re:LINQ Ruined My Favorite Interview Question
by 1wheel on Thursday July 11, 2013 @06:08PM
(#6029582)
JS isn't that bad if w/ underscore or d3:
d3.entries((s.split(" ").reduce(function(p, v){
v in p ? p[v]++ : p[v] = 1;
return p;}, {})))
.sort(function(a, b){ return a.value > b.value; })
.map(function(d){ return d.key;})
.slice(-10);