LRU Cache
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. […]
Given the head of a linked list that may contain a loop. A loop means that the last node of
Given a head of the singly linked list. If a loop is present in the list then return the first node of the loop else return NULL. Custom Input format:A head of a
You are given the head of a singly linked list. Your task is to determine if the linked list contains a loop. A
You are given a special linked list with n nodes where each node has two pointers a next pointer that points to the next
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
Given the head a linked list, the task is to reverse every k node in the linked list. If the number of nodes is not a
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:
Given the head of a singly linked list, your task is to left rotate the linked list k times. Examples: Input: head = 10 -> 20
Given the head of a linked list, the task is to reverse this list and return the reversed head. Examples: Input: head: 1 ->
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
Given an array arr of 0s and 1s. Find and return the length of the longest subarray with equal number of 0s and 1s. Examples: Input: