Skip to content

Commit 9653387

Browse files
committed
utils, fixes
1 parent a2eb949 commit 9653387

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

src/Linked List/234. Palindrome Linked List.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,7 @@
1010
* Time Complexity: O(n), Space Complexity: O(1)
1111
*/
1212

13-
class ListNode {
14-
val: number;
15-
next: ListNode | null;
16-
constructor(val?: number, next?: ListNode | null) {
17-
this.val = val === undefined ? 0 : val;
18-
this.next = next === undefined ? null : next;
19-
}
20-
}
21-
22-
function isPalindrome(head: ListNode | null): boolean {
13+
function isLinkedListPalindrome(head: ListNode | null): boolean {
2314
let slow = head;
2415
let fast = head;
2516

src/data-structures.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class ListNode {
2+
val: number;
3+
next: ListNode | null;
4+
constructor(val?: number, next?: ListNode | null) {
5+
this.val = val === undefined ? 0 : val;
6+
this.next = next === undefined ? null : next;
7+
}
8+
}

tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2017",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": false,
8+
"noEmit": true,
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "bundler",
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"jsx": "preserve",
15+
"incremental": true,
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
],
21+
"paths": {
22+
"@/*": ["./src/*"]
23+
}
24+
},
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26+
"exclude": ["node_modules"]
27+
}

0 commit comments

Comments
 (0)