diff --git a/chapter01/1.2 - Check Perm/checkPermute.js b/chapter01/1.2 - Check Perm/checkPermute.js index 0cb0931..0994f52 100644 --- a/chapter01/1.2 - Check Perm/checkPermute.js +++ b/chapter01/1.2 - Check Perm/checkPermute.js @@ -14,6 +14,8 @@ var checkPermute = function(stringOne, stringTwo) { // Tests console.log(checkPermute('aba', 'aab'), true); +console.log(checkPermute('aba', 'bba'), false); + console.log(checkPermute('aba', 'aaba'), false); console.log(checkPermute('aba', 'aa'), false); \ No newline at end of file diff --git a/chapter01/1.3 - URLify/urlify-4.js b/chapter01/1.3 - URLify/urlify-4.js new file mode 100644 index 0000000..5ba3c8a --- /dev/null +++ b/chapter01/1.3 - URLify/urlify-4.js @@ -0,0 +1,6 @@ +function urlify(s) { + s = s.split(' ').filter(el => el !== '').join('%20');; + return s; +} + +console.log(urlify('Mr John Smith ')); \ No newline at end of file