1460. Make Two Arrays Equal by Reversing Subarrays
You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You […]
You are given two integer arrays of equal length target and arr. In one step, you can select any non-empty subarray of arr and reverse it. You […]
A celebrity is a person who is known to all but does not know anyone at a party. A party is being
A swap is defined as taking two distinct positions in an array and swapping the values in them. A circular array is defined as an array
Given two strings str1 and str2. Return the minimum number of operations required to convert str1 to str2.The possible operations are permitted: Insert a character at any
You are given a 0-indexed array of strings details. Each element of details provides information about a given passenger compressed into a string of length 15.
You are given a rectangular matrix, and your task is to return an array while traversing the matrix in spiral form. Examples: Input: matrix[][]
You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth.
Given an array of strings arr. Return the longest common prefix among all strings present in the array. If there’s no prefix common in all
You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is no
Consider a rat placed at (0, 0) in a square matrix mat of order n* n. It has to reach the destination at (n – 1,
There are n soldiers standing in a line. Each soldier is assigned a unique rating value. You have to form a team of 3 soldiers
Given a boolean 2D array, consisting of only 1’s and 0’s, where each row is sorted. Find the 0-based index of