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 createLaundryItem() { | |
let count = 0; | |
const tasks = [ | |
"soak", | |
"wash", | |
"rinse", | |
"spin", | |
"dry", | |
]; |
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
// To find the optimal groups we can use bin packing. | |
// https://en.wikipedia.org/wiki/Bin_packing_problem | |
const files = [120, 90, 60, 150, 80]; | |
const maxDuration = 200; | |
function groupAudioFiles(files, maxDuration) { | |
// Sort files in descending order | |
const sorted = [...files].sort((a, b) => b - a); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>chat</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
margin: 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Window 1</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
margin: 20px; |
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
diff --git a/src/mame/cave/cv1k.cpp b/src/mame/cave/cv1k.cpp | |
index c57694f92aa..14865cc0b5b 100644 | |
--- a/src/mame/cave/cv1k.cpp | |
+++ b/src/mame/cave/cv1k.cpp | |
@@ -917,32 +917,32 @@ ROM_START( dfkbl ) | |
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(31f9eb0a) SHA1(322158779e969bb321241065dd49c1167b91ff6c) ) | |
ROM_END | |
-// ROM_START( akatana ) | |
-// ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF) |
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 input = await Deno.readTextFile("input.txt"); | |
type Position = { x: number; y: number }; | |
type Direction = "up" | "down" | "left" | "right"; | |
type Guard = { | |
position: Position; | |
direction: Direction; | |
}; |
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 input = await Deno.readTextFile("input.txt"); | |
type Rule = { | |
x: number; | |
y: number; | |
}; | |
const [order, pages] = input.split("\n\n"); | |
function parseRules(rules: string): Rule[] { |
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 input = await Deno.readTextFile("input.txt"); | |
const directions = [ | |
[0, 1], | |
[0, -1], | |
[1, 0], | |
[1, 1], | |
[1, -1], | |
[-1, 0], | |
[-1, -1], |
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 input = await Deno.readTextFile("input.txt"); | |
function matchMuls(str: string): string[] { | |
return str.match(/mul\(\d+,\d+\)/g) || []; | |
} | |
function calculateMulSum(arr: string[]): number { | |
return arr.reduce((acc, str) => { | |
const [a, b] = str.slice(4, -1).split(",").map(Number); | |
return acc + a * b; |
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 input = await Deno.readTextFile("input.txt"); | |
const data = input.split("\n"); | |
let left: number[] = []; | |
let right: number[] = []; | |
for (const pair of data) { | |
const [a, b] = pair.split(" "); | |
left.push(+a); | |
right.push(+b); |
NewerOlder