From c17a7e9f90250b7cc9b501f170dcf5aed9309a37 Mon Sep 17 00:00:00 2001 From: Hyewon Joo Date: Tue, 5 Apr 2022 23:59:56 -0700 Subject: [PATCH 1/2] added new test case to show another example of false result with same length of both strings --- chapter01/1.2 - Check Perm/checkPermute.js | 2 ++ 1 file changed, 2 insertions(+) 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 From 32ecff16c452dd26815d44c4eb318d3b06c3c760 Mon Sep 17 00:00:00 2001 From: Hyewon Joo Date: Wed, 6 Apr 2022 00:04:54 -0700 Subject: [PATCH 2/2] added new solution --- chapter01/1.3 - URLify/urlify-4.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 chapter01/1.3 - URLify/urlify-4.js 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