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 BracketMatcher(str) { | |
var lP = 0; | |
var rP = 0; | |
for (var i=0; i<str.length; i++) { | |
if(str[i] === '(') lP++; | |
if(str[i] === ')') rP++; | |
if(rP > lP) return 0; | |
} | |
if (rP === lP) return 1; | |
return 0; |
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) { | |
for (let i = 2; i < num; i++) { | |
if (num % i === 0) { | |
return false | |
} | |
} | |
return true; | |
} | |
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 CountingMinutesI(str) { | |
var time10bj = {}, time20bj = {}, timeDiff; | |
time10bj = setTimeObject(str, 0); | |
time20bj = setTimeObject(str, 1); | |
if (time10bj.ampm == time20bj.ampm && time10bj.tot > time20bj.tot) { | |
timeDiff = (((12 - time10bj.hours + 12) * 60) - (time10bj.mins)) + ((time20bj.hours * 60) + time20bj.mins); | |
} |
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 ABCheck(str) { | |
var arr = str.toLowerCase().split("").join("").replace( /\s/g, "") | |
for(var i = 0; i < arr.length; i++) { | |
if(arr[i].indexOf('a') != -1 && arr[i+3].indexOf('b') != -1) { | |
return true | |
} | |
} | |
return str; | |
} |
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
import React, { useState } from 'react'; | |
import ReactDOM from 'react-dom'; | |
const rowStyle = { | |
display: 'flex' | |
} | |
const squareStyle = { | |
'width':'60px', | |
'height':'60px', |
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
import React, { useState } from 'react'; | |
import ReactDOM from 'react-dom'; | |
const style = { | |
table: { | |
borderCollapse: 'collapse' | |
}, | |
tableCell: { | |
border: '1px solid gray', | |
margin: 0, |