gfg-potd

LRU Cache

gfg-potd

Design a data structure that works like a LRU Cache. Here cap denotes the capacity of the cache and Q denotes the number of queries. […]

Add Number Linked Lists

gfg-potd

Given the head of two singly linked lists num1 and num2 representing two non-negative integers. The task is to return the head of the linked list

Merge two sorted linked lists

gfg-potd

Given the head of two sorted linked lists consisting of nodes respectively. The task is to merge both lists and return the head of the sorted merged list. Examples:

Rotate a Linked List

gfg-potd

Given the head of a singly linked list, your task is to left rotate the linked list k times. Examples: Input: head = 10 -> 20

Reverse a linked list

gfg-potd

Given the head of a linked list, the task is to reverse this list and return the reversed head. Examples: Input: head: 1 ->

Product array puzzle

gfg-potd

Given an array, arr[] construct a product array, res[] where each element in res[i] is the product of all elements in arr[] except arr[i]. Return this resultant array, res[].Note: Each

Scroll to Top