Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions chapter01/1.2 - Check Perm/checkPermute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
6 changes: 6 additions & 0 deletions chapter01/1.3 - URLify/urlify-4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function urlify(s) {
s = s.split(' ').filter(el => el !== '').join('%20');;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most interviews, they'll want you to write the actual logic other than using in-built function like this, esp if that is part of the question and not just a utility.

return s;
}

console.log(urlify('Mr John Smith '));