396 Rotate Function
Rotate Function You are given an integer array nums of length n. Assume arrk to be an array obtained by rotating nums by k positions clock-wise. We define the rotation function F on nums as foll...
Rotate Function You are given an integer array nums of length n. Assume arrk to be an array obtained by rotating nums by k positions clock-wise. We define the rotation function F on nums as foll...
Maximum Score From Grid Operations You are given a 2D matrix grid of size n x n. Initially, all cells of the grid are colored white. In one operation, you can select any cell of indices (i, j), a...
Minimum Operations to Make a Uni-Value Grid You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid. A uni-v...
Check if There is a Valid Path in a Grid You are given an m x n grid. Each cell of grid represents a street. The street of grid[i][j] can be: 1 which means a street connecting the left cell and ...
Maximize the Distance Between Points on a Square You are given an integer side, representing the edge length of a square with corners at (0, 0), (0, side), (side, 0), and (side, side) on a Cartes...
Detect Cycles in 2D Grid Given a 2D array of characters grid of size m x n, you need to find if there exists any cycle consisting of the same value in grid. A cycle is a path of length 4 or more...
Words Within Two Edits of Dictionary You are given two string arrays, queries and dictionary. All words in each array comprise of lowercase English letters and have the same length. In one edit ...
Sum of Distances You are given a 0-indexed integer array nums. There exists an array arr of length nums.length, where arr[i] is the sum of i - j over all j such that nu...
Two Furthest Houses With Different Colors There are n houses evenly lined up on the street, and each house is beautifully painted. You are given a 0-indexed integer array colors of length n, wher...
Maximum Distance Between a Pair of Values You are given two **non-increasing 0-indexed **integer arrays nums1 and nums2. A pair of indices (i, j), where 0 <= i < nums1.length a...