Last active
March 5, 2019 19:55
-
-
Save dansackett/6d0381ca3e81c05fbb82c7a1210faca5 to your computer and use it in GitHub Desktop.
Revisions
-
dansackett revised this gist
Mar 5, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ /* Given a string "s1" eg. ABKHJDLNCMLNCKS @@ -9,7 +10,6 @@ eg. AKHJDMNS write a function that determines whether the characters in s2 are a subset of the characters in s1. (ie. are all of the characters in s2 also in s1) Note that this is a strict subset: so AAB is not a subset of ABCC -
dansackett renamed this gist
Mar 5, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dansackett created this gist
Mar 5, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ Given a string "s1" eg. ABKHJDLNCMLNCKS and another string with a length equal to or less than s1, called "s2" eg. AKHJDMNS write a function that determines whether the characters in s2 are a subset of the characters in s1. (ie. are all of the characters in s2 also in s1) /* Note that this is a strict subset: so AAB is not a subset of ABCC AC, however, would be a subset, as would CA -it should take s1 as its first parameter, and s2 as its second -it should return true or false */ function isSubset(s1, s2){ // returns true or false } isSubset('ABCDEF', 'BE') // returns true isSubset('a', 'A') // returns false isSubset(' ABCDEF', 'FEDD') // returns false isSubset(' bac', 'c') // returns true