Skip to content

Instantly share code, notes, and snippets.

View leonardonicola's full-sized avatar
💻
estudando!

Leonardo Nicola leonardonicola

💻
estudando!
View GitHub Profile
@leonardonicola
leonardonicola / index.ts
Last active June 7, 2024 00:15
LRU Cache with Map and Linked List
class ListNode<T> {
next: ListNode<T> | null = null;
constructor(readonly data: T) {}
}
class LinkedList {
private size: number = 0;
private head: ListNode<string> | null = null;
get(data: string): null | unknown {