Skip to content

Instantly share code, notes, and snippets.


jezinka/main.js Secret

Created Jun 16, 2017
What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment