mkdir [name] cd [name] echo "{}" > package.json npm install next react react-dom
// add "scripts" to package.json // // "scripts": { // "dev": "next dev", // "build": "next build",
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="next-head" content="1" /> | |
<script> | |
document.documentElement.classList.add("__variable_20951f"); | |
</script> | |
<meta name="next-head" content="1" /> | |
<script> |
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
html, | |
body { | |
padding: 0; | |
margin: 0; | |
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, | |
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; |
mkdir [name] cd [name] echo "{}" > package.json npm install next react react-dom
// add "scripts" to package.json // // "scripts": { // "dev": "next dev", // "build": "next build",
// stones = [2,7,4,1,8,1] | |
function minHeapify(arr: number[]): number[]{ | |
// push 0-th position to the end | |
arr.push(arr[0]) // [2, 7, 4, 1, 8, 1, 2] | |
// we will ignore arr[0] for math purposes | |
let heap = arr | |
let cur = Math.floor(heap.length - 1)/2 // (7-1)/2 = 6/2 = 3 | |
/* | |
7(1) |
function maxHeapify(arr: any): any { | |
arr.push(arr[0]) // push 0th position to end | |
let heap = arr | |
let cur = Math.floor(heap.length - 1)/2 | |
while (cur > 0) { // ignore the 0th index bc we pushed that value to the end | |
// go from the half way mark down to 1 | |
let i = cur // start a the half way and work back up to 1 | |
// while left child position is less than length of heap | |
while (2 * i < heap.length) { // while cur has a left child | |
if (2 * i + 1 < heap.length && // if cur has a right child too |
{ | |
"name": "leet-live", | |
"version": "1.0.0", | |
"description": "", | |
"main": "solution.js", | |
"scripts": { | |
"test": "jest" | |
}, | |
"keywords": [], | |
"author": "", |
const romanToInt = require("./solution"); | |
test("III to equal 3", () => { | |
expect(romanToInt("III")).toBe(3); | |
}); | |
test("IV to equal 4", () => { | |
expect(romanToInt("IV")).toBe(4); | |
}); |
const romanNumeralKey = [ | |
["I", 1], | |
["V", 5], | |
]; | |
const romanNumeralLookup = { | |
I: 1, | |
V: 5, | |
X: 10, | |
L: 50, |
import React, { useState } from 'react' | |
export default function Home() { | |
const colors : string[] = ["bg-emerald-500", "bg-red-500", "bg-yellow-500", "bg-emerald-800", "bg-emerald-900"] | |
return ( | |
<div className={"h-screen"}> | |
<ColorBox | |
colors={colors} | |
/> |