This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Google tag (gtag.js) --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){window.dataLayer.push(arguments);} | |
gtag('js', new Date()); | |
gtag('config', 'GA_TRACKING_ID'); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Division(num1, num2) { | |
let num1Factors = []; | |
let num2Factors = []; | |
let commonFactors = [] | |
for (let i = 1; i < num1; i++) { | |
if (num1 % i === 0) { | |
num1Factors.push(i) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PalindromeTwo(str) { | |
let tempStr = []; | |
let straightStr = []; | |
let reverseStr; | |
let res = true; | |
let string = | |
str.split(' ').join(' ').toLowerCase().split('').forEach(element => { | |
if (element.match(/[a-z]/g)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Have the function RunLength(str) take the str parameter being passed and | |
return a compressed version of the string using the Run-length encoding algorithm. | |
This algorithm works by taking the occurrence of each repeating character and outputting | |
that number along with a single character of the repeating sequence. For example: "wwwggopp" would return 3w2g1o2p. | |
The string will not contain any numbers, punctuation, or symbols. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PrimeTime(num) { | |
if (num === 2) { | |
return true; | |
} | |
for (let i = 2; i < num; i++) { | |
if (num % i !== 0) { | |
return true | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BasicRomanNumerals(str) { | |
let arr = [] | |
str.split('').forEach(num => { | |
switch (num) { | |
case 'I': | |
arr.push(1); | |
break; | |
case 'V': | |
arr.push(5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CountingMinutes(str) { | |
let string = str.split('-') | |
let start = string[0]; | |
let end = string[1]; | |
let output; | |
let minuteMaker = function (data) { | |
let hours; | |
let minutes; | |
let time; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MaxSubArray(arr) { | |
let currentSum = arr[0]; | |
let maxSum = arr[0]; | |
for (let i = 1; i < arr.length; i++) { | |
currentSum = Math.max(currentSum + arr[i], arr[i]) | |
maxSum = Math.max(maxSum, currentSum); | |
} | |
return maxSum; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const encrypt = function (str, num) { | |
let string = str.split(' ').join(' ').split(''); | |
let alphabets = 'abcdefghijklmnopqrstuvwxyz'; | |
let capitalAlphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
let alphabetsArr = alphabets.split('') | |
let capitalAlphabetsArr = capitalAlphabets.split(''); | |
let x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BitwiseTwo(strArr) { | |
let x = strArr[0].split(''); | |
let y = strArr[1].split(''); | |
let z = []; | |
for (let i = 0; i < x.length; i++) { | |
if (x[i] === '1' && y[i] === '1') { | |
z[i] = '1'; | |
} else { |
NewerOlder