shreyansh

Arrays and Search Problems

  1. 0 1 Matrix

    Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.

  2. 1004. Max Consecutive Ones III

    Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at

  3. 1679. Max Number of K Sum Pairs

    You are given an integer array nums and an integer k.

  4. 238. Product of Array Except Self

    Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of n

  5. 283. Move Zeroes

    Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements

  6. 3 Sum

    Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, a

  7. 724. Find Pivot Index

    Given an array of integers nums, calculate the pivot index of this array.

  8. Capacity To Ship Packages Within D Days

    A conveyor belt has packages that must be shipped from one port to another within daysdays.

  9. Find Minimum in Rotated Sorted Array

    Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [

  10. Find Peak Element

    A peak element is an element that is strictly greater than its neighbors.

  11. Find the nth Root

    Understanding the Problem:

  12. First Bad Version

    You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of yo

  13. First and Last Position Of An Element In A Sorted Array

    Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target

  14. K Sum

    Given an array nums of n integers, return an array of all the unique quadruplets[nums[a], nums[b], nums[c], nums[d]] suc

  15. Koko Eating Bananas

    Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and wil

  16. Kth Smallest Number in Multiplication Table

    Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix matwhere

  17. Maximum Points You Can Obtain from Cards

    There are several cards arranged in a row, and each card has an associated number of points. The points are given in the

  18. Maximum Subarray

    Given an integer array nums, find the subarray with the largest sum, and return its sum.

  19. Merge Intervals

    Given an array of intervals where intervals[i] = \[starti, endi\], merge all overlapping intervals, and return an array

  20. Minimum Number of Days to Make m Bouquets

    You are given an integer array bloomDay, an integer m and an integer k.

  21. Minimum Size Subarray Sum

    Given an array of positive integers nums and a positive integer target, return the minimal length of a

  22. Minimum consecutive cards to pick

    You are given an integer array cards where cards[i] represents the value of the ith card. A pair of cards are matching i

  23. Minimum in rotated sorted array II

    Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [

  24. Number of Sub arrays of Size K and Average Greater than or Equal to Threshold

    Given an array of integers arr and two integers k and threshold, return the number of sub-arrays of size k and average g

  25. Search Insert Position

    Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return th

  26. Search in Rotated Sorted Array

    There is an integer array nums sorted in ascending order (with distinct values).

  27. Search in Rotated Sorted Array II

    There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).

  28. Single Element in a Sorted Array

    You are given a sorted array consisting of only integers where every element appears exactly twice, except for one eleme

  29. Split Array Largest Sum

    Given an integer array nums and an integer k, split nums into k non-empty subarrays such that the largest sum of any sub

  30. Sqrt(x)

    Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer sh

  31. Two Sum 2 Input array is sorted

    Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that t

More in this folder

  1. First Bad Version [Easy]

    You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of yo