Skip to content

Commit

Permalink
utils, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Fisher committed Dec 21, 2024
1 parent a2eb949 commit 9653387
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/Linked List/234. Palindrome Linked List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,7 @@
* Time Complexity: O(n), Space Complexity: O(1)
*/

class ListNode {
val: number;
next: ListNode | null;
constructor(val?: number, next?: ListNode | null) {
this.val = val === undefined ? 0 : val;
this.next = next === undefined ? null : next;
}
}

function isPalindrome(head: ListNode | null): boolean {
function isLinkedListPalindrome(head: ListNode | null): boolean {
let slow = head;
let fast = head;

Expand Down
8 changes: 8 additions & 0 deletions src/data-structures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class ListNode {
val: number;
next: ListNode | null;
constructor(val?: number, next?: ListNode | null) {
this.val = val === undefined ? 0 : val;
this.next = next === undefined ? null : next;
}
}
27 changes: 27 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 9653387

Please sign in to comment.