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
33 changes: 30 additions & 3 deletions session1/index_extra.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
// CHALLENGE 1: REVERSE A STRING
// Return a string in reverse
// ex. reverseString('hello') === 'olleh'
Expand Down Expand Up @@ -232,13 +231,41 @@ function fizzBuzz() {
// }
// console.log(output);
// }

}
/* FIZZBUZZ - CONTRIBUTED SOLUTION BY @sheygs_ 👇*/

// generates a range of number between 1 and max
// const generateMaxSequence = max => {
// return Array(max)
// .fill()
// .map((_,i) => i + 1);
// }

// const fizzBuzz = num => {
// return generateMaxSequence(num).map(num => {
// switch(true){
// case (num % 15 === 0):
// return "FizzBuzz";
// case (num % 3 === 0):
// return "Fizz";
// case (num % 5 === 0):
// return "Buzz";
// default:
// return num;
// }
// }). join(', ');
// }

// const fizzBuzzSequence = fizzBuzz(30);

/* FIZZBUZZ - CONTRIBUTED SOLUTION BY @sheygs_ 👆 */

// Call Function
const output = reverseString('hello');

console.log(output);
=======

// CHALLENGE 1: REVERSE A STRING
// Return a string in reverse
// ex. reverseString('hello') === 'olleh'
Expand Down Expand Up @@ -412,4 +439,4 @@ function fizzBuzz() {
const output = reverseString('hello');

console.log(output);
>>>>>>> e8090fea1d9fe2c208a8f8ce4cc46be9f287b108

5 changes: 5 additions & 0 deletions session3/index_extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ console.log(sumAllPrimes(10))

function seekAndDestroy() {}

/* SEEKANDDESTROY CONTRIBUTED SOLUTION BY @sheygs_ 👇*/
const seekAndDestroy = (list,...inputs) => list.filter(item => !inputs.includes(item));
/* END OF CONTRIBUTED SOLUTION BY @sheygs_ 👆 */


// CHALLENGE 4: SORT BY HEIGHT
// Some people are standing in a row in a park. There are trees between them which cannot be moved. Your task is to rearrange the people by their heights in a non-descending order without moving the trees.
// ex.
Expand Down