1,724 articles across 10 categories

Stories, Tutorials & Life Tips

Deep dives on coding, health, recipes, travel and everything in between.

📍 Explore Reading Paths

Follow curated journeys from beginner to expert

Minimum Absolute Difference - Array - Easy - LeetCode
Featured

Minimum Absolute Difference - Array - Easy - LeetCode

Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements.  Return a list of pairs in ascending order(with respect to pairs), e

2 min read12 Jun 2020
Read article
Play with Chips - Array - Easy - LeetCode

Play with Chips - Array - Easy - LeetCode

There are some chips, and the i-th chip is at position chips[i]. You can perform any of the two following types of move

3 min12 Jun
Check If It Is a Straight Line - Array - Easy - LeetCode

Check If It Is a Straight Line - Array - Easy - LeetCode

You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if

2 min12 Jun
Cells with Odd Values in a Matrix - Array - Easy - LeetCode

Cells with Odd Values in a Matrix - Array - Easy - LeetCode

Given n and m which are the dimensions of a matrix initialized by zeros and given an array indices where indices[i] = [r

2 min11 Jun
Shift 2D Grid - Array - Easy - LeetCode

Shift 2D Grid - Array - Easy - LeetCode

Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Element at

3 min11 Jun
Minimum Time Visiting All Points - Array - Easy - LeetCode

Minimum Time Visiting All Points - Array - Easy - LeetCode

On a plane there are n points with integer coordinates points[i] = [xi, yi]. Your task is to find the minimum time in se

2 min11 Jun
Find Winner on a Tic Tac Toe Game - Array - Easy - LeetCode

Find Winner on a Tic Tac Toe Game - Array - Easy - LeetCode

Tic-tac-toe is played by two players A and B on a 3 x 3 grid. Here are the rules of Tic-Tac-Toe: Players take turns pl

5 min10 Jun
Element Appearing More Than 25% In Sorted Array - Easy - LeetCode

Element Appearing More Than 25% In Sorted Array - Easy - LeetCode

Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 2

1 min10 Jun
Find Numbers with Even Number of Digits - Array - Easy - LeetCode

Find Numbers with Even Number of Digits - Array - Easy - LeetCode

Given an array nums of integers, return how many of them contain an even number of digits.   Example 1: Input: n

1 min10 Jun
Replace Elements with Greatest Element on Right Side - Array - Easy - LeetCode

Replace Elements with Greatest Element on Right Side - Array - Easy - LeetCode

Given an array arr, replace every element in that array with the greatest element among the elements to its right, and r

1 min8 Jun
Find N Unique Integers Sum up to Zero - Array - Easy - LeetCode

Find N Unique Integers Sum up to Zero - Array - Easy - LeetCode

Given an integer n, return any array containing n unique integers such that they add up to 0.   Example 1: Input

1 min8 Jun
Decompress Run-Length Encoded List - Array - Easy - LeetCode

Decompress Run-Length Encoded List - Array - Easy - LeetCode

We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pa

2 min8 Jun
Rank Transform of an Array - Easy - LeetCode

Rank Transform of an Array - Easy - LeetCode

Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The r

2 min8 Jun
The K Weakest Rows in a Matrix - Array - Easy - LeetCode

The K Weakest Rows in a Matrix - Array - Easy - LeetCode

Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k

6 min8 Jun
Check If N and Its Double Exist - Array - Easy - LeetCode

Check If N and Its Double Exist - Array - Easy - LeetCode

Given an array arr of integers, check if there exist two integers N and M such that N is the double of M ( i.e. N = 2 *

2 min7 Jun