-
-
Save jezinka/012caa530e9e7d06cf153f89fd8b2bc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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