Skip to content

Instantly share code, notes, and snippets.

@jezinka

jezinka/main.js Secret

Created June 16, 2017 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/012caa530e9e7d06cf153f89fd8b2bc5 to your computer and use it in GitHub Desktop.
Save jezinka/012caa530e9e7d06cf153f89fd8b2bc5 to your computer and use it in GitHub Desktop.
var x = encrypted[i].split("");
var y = x.sort(); // tu będzie ["a", "a", "c", "c", "e", "e", "e", "f", "j", "l", "m", "n", "o", "p", "p", "p", "p", "t", "u", "w", "x", "y", "y", "y", "z"]
var a = y.byCount(); // tu uporządkowane wg częstotliwości ["p", "e", "y", "a", "c", "l", "m", "n", "z", "f", "t", "u", "w", "x", "j", "o"]
var b = a.slice(0, 5);
var c = b.toString();
var re = /,/gi;
var d = c.replace(re, ""); //dostaniemy 5 najczęściej występujących liter
finall.push(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment