1
0

Initial commit

This commit is contained in:
2025-12-16 20:39:11 +00:00
commit 8ae9352aa1
70 changed files with 3898 additions and 0 deletions

25
src/day1/Stack.test.ts Normal file
View File

@@ -0,0 +1,25 @@
import Stack from "@code/Stack";
test("stack", function () {
const list = new Stack<number>();
list.push(5);
list.push(7);
list.push(9);
expect(list.pop()).toEqual(9);
expect(list.length).toEqual(2);
list.push(11);
expect(list.pop()).toEqual(11);
expect(list.pop()).toEqual(7);
expect(list.peek()).toEqual(5);
expect(list.pop()).toEqual(5);
expect(list.pop()).toEqual(undefined);
// just wanted to make sure that I could not blow up myself when i remove
// everything
list.push(69);
expect(list.peek()).toEqual(69);
expect(list.length).toEqual(1);
});