This Gist was automatically created by Carbide, a free online programming environment.
Last active
September 4, 2016 15:55
-
-
Save peterschussheim/fc034cea663e50dd3c7ca44f461b19a5 to your computer and use it in GitHub Desktop.
Sets
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
const longest = (s1, s2) => [...new Set(s1 + s2)].sort().join('') ///Create a function that accepts two strings s1 and s2, that returns a new string that is sorted and as long as possible, only using unique letters from s1 and s2. | |
a = "xyaabbbccccdefww" | |
b = "xxxxyyyyabklmopq" | |
longest(a, b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment