AGAlkesh Ghorpadeinalkesh26.hashnode.dev·Jun 29, 2023 · 7 min readMax Sum of Rectangle No Larger Than KProblem statement Given an m x n matrix matrix and an integer k, return the max sum of a rectangle in the matrix such that its sum is no larger than k. It is guaranteed that there will be a rectangle with a sum no larger than k. Problem statement tak...00
AGAlkesh Ghorpadeinalkesh26.hashnode.dev·Jun 25, 2023 · 9 min readMaximum GapProblem statement Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0. You must write an algorithm that runs in linear time and uses lin...00
AGAlkesh Ghorpadeinalkesh26.hashnode.dev·Jun 22, 2023 · 7 min readOdd Even Linked ListProblem statement Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. ...00
AGAlkesh Ghorpadeinalkesh26.hashnode.dev·Jun 15, 2023 · 10 min readSudoku SolverProblem statement Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Each of the digits 1-9 must occur exactly once in each row. Each of the digits 1-9 must occur exactly on...00
AGAlkesh Ghorpadeinalkesh26.hashnode.dev·Jun 11, 2023 · 9 min readImplement LRU CacheProblem statement Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initialize the LRU cache with positive size capacity. int get(int key) Return the valu...00