Sharing here what I learned and likes
function nonRepeaters(s) { var h={}; return s.split(""). map(function(c){h[c] |= 0; h[c]++; console.log(c); return c}). filter(function(c){console.log(h[c]);return h[c] == 1}). join(""); } nonRepeaters("abcab")
comment here
No comments:
Post a Comment
comment here