This file contains 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 NumericSequencer = () => { | |
let userInput = prompt(); | |
let currMax = userInput; | |
let occurrences = 0; | |
while (userInput != 0) { | |
if (userInput > currMax) { | |
currMax = userInput; | |
occurrences = 1; | |
} else if (userInput == currMax) { |
This file contains 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 digitSummer = (input) => { | |
if (input < 10 || input === 0) return input; | |
return (input % 10) + digitSummer(Math.floor(input / 10)); | |
}; |
This file contains 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 priceCheck = (products, productPrices, productSold, soldPrice) => { | |
let incorrectSales = 0; | |
productSold.forEach((product, index) => { | |
if (soldPrice[index] !== productPrices[products.indexOf(product, index)]) { | |
incorrectSales++; | |
} | |
}); | |
return incorrectSales; |
This file contains 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
/* main.c */ | |
#include <stdio.h> | |
#include <sdtlib.h> | |
int main(int argc, char *argv[]) { | |
pid_t pid; | |
if( (pid = fork() ) < 0){ | |
printf("Fork error"); | |
}else{ |
This file contains 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
Test |
This file contains 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 longestSuset(array) { | |
let arrLen = array.length; | |
let maxSubsetCount = new Array(arrLen).fill(1); | |
for (i = 1; i < arrLen; i++) { | |
for (j = 0; j < i; j++) { | |
if (array[i] > array[j] && maxSubsetCount[i] <= maxSubsetCount[j]) { | |
maxSubsetCount[i] = maxSubsetCount[j] + 1; | |
} | |
} |
This file contains 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
/*exe 1 turn time in seconds to H:M:S format | |
int totalTime; | |
printf("Enter time in seconds \n \n \n"); | |
scanf("%d", &totalTime); | |
int hours = totalTime / 3600; | |
totalTime = totalTime - hours*3600; | |
int minuts = totalTime % 60; | |
totalTime = totalTime - minuts*60; | |
int secs = totalTime ; |