I hereby claim:
- I am elitenomad on github.
- I am elitenomad (https://keybase.io/elitenomad) on keybase.
- I have a public key whose fingerprint is 6803 769F 8D8B 79CF F5AE 46F2 5FDA 3049 AFF8 B453
To claim this, I am signing this object:
| const joinElements = (array, joiner) => { | |
| const recurse = (index, resultSoFor = '') => { | |
| resultSoFor += array[index]; | |
| if (index == array.length - 1) { | |
| return resultSoFor; | |
| } else { | |
| resultSoFor = resultSoFor + joiner; | |
| return recurse(index + 1, resultSoFor); | |
| } |
| const factorialWithRecursive = (n) => { | |
| if(n == 1){ | |
| return n; | |
| }else{ | |
| return (n * factorialWithRecursive(n - 1)); | |
| } | |
| } | |
| const factorialRecursive = factorialWithRecursive(5); | |
| console.log(`What is factorialRecursive ${factorialRecursive}`); |
| const factorialRecursiveWithMemoization = (n) => { | |
| const multiplyer = (ender) => { | |
| if(ender == 1){ | |
| return ender; | |
| }else{ | |
| return (ender * multiplyer(ender - 1)) | |
| } | |
| } | |
| return multiplyer(n); |
| const binary_search = (list, item) => { | |
| let min = 0; | |
| let max = list.length - 1; | |
| let middle_index = Math.floor((min + max)/2); | |
| while(min <= max){ | |
| if(list[middle_index] == item) { | |
| return list[middle_index]; | |
| } |
| const bubble_sort = (array) => { | |
| for(let i = 0 ; i < array.length - 1 ; i++) { | |
| for(let j = 0; j < array.length - i - 1; j++){ | |
| if(array[j] > array[j + 1]){ | |
| const temp = array[j]; | |
| array[j] = array[j+1]; | |
| array[j+1] = temp; | |
| } | |
| } | |
| } |
I hereby claim:
To claim this, I am signing this object:
| function removeDuplicate(str) { | |
| arr = [] | |
| prev_value = '' | |
| splitted_str = str.split(' ') | |
| splitted_str.forEach((s) => { | |
| console.log("prev value", prev_value) | |
| console.log("s value", s) | |
| if(s !== prev_value) { | |
| arr.push(s); |
| function flatten(arr) { | |
| a = [] | |
| arr.forEach((s) => { | |
| if(Array.isArray(s)){ | |
| a = a.concat(flatten(s)) | |
| }else{ | |
| a.push(s) | |
| } | |
| }) | |
| function.prototype.bind = function(context) { | |
| var fn = this | |
| return function(){ | |
| fn.call(context); | |
| } | |
| } |
| function debounce(fn, time) { | |
| let setTimeOutId; | |
| const context = this; | |
| return function() { | |
| if(setTimeoutId) { | |
| clearTimeout(setTimeoutId); | |
| } | |
| setTimeoutId = setTimeout(function(){ |