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

X of a Kind in a Deck of Cards - Array - Easy - LeetCode
Featured

X of a Kind in a Deck of Cards - Array - Easy - LeetCode

In a deck of cards, each card has an integer written on it. Return true if and only if you can choose X >= 2 such that it is possible to split the entire deck into 1 or more groups of cards, where:…

1 min read27 Sept 2020
Read article
Sort Array By Parity - Array - Easy - LeetCode

Sort Array By Parity - Array - Easy - LeetCode

Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the…

1 min27 Sept
Monotonic Array - Array - Easy - LeetCode

Monotonic Array - Array - Easy - LeetCode

An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if f…

1 min27 Sept
Fair Candy Swap - Array - Easy - LeetCode

Fair Candy Swap - Array - Easy - LeetCode

Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is …

1 min27 Sept
Transpose Matrix - Array - Easy - LeetCode

Transpose Matrix - Array - Easy - LeetCode

Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diagonal, sw…

1 min26 Sept
Flipping an Image - Array - Easy - LeetCode

Flipping an Image - Array - Easy - LeetCode

Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image. To flip…

1 min26 Sept
Positions of Large Groups - Array - Easy - LeetCode

Positions of Large Groups - Array - Easy - LeetCode

In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string l…

1 min26 Sept
Toeplitz Matrix - Array - Easy - LeetCode

Toeplitz Matrix - Array - Easy - LeetCode

A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, re…

1 min26 Sept
Largest Number At Least Twice of Others

Largest Number At Least Twice of Others

In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the arra…

1 min26 Sept
Min Cost Climbing Stairs - Array - Easy - LeetCode

Min Cost Climbing Stairs - Array - Easy - LeetCode

On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can ei…

1 min26 Sept
Find Pivot Index - Array - Easy - LeetCode

Find Pivot Index - Array - Easy - LeetCode

Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index …

1 min26 Sept
1-bit and 2-bit Characters - Array - Easy - LeetCode

1-bit and 2-bit Characters - Array - Easy - LeetCode

We have two special characters. The first character can be represented by one bit 0. The second character can be represe…

1 min26 Sept
Longest Continuous Increasing Subsequence - Array - Easy - LeetCode

Longest Continuous Increasing Subsequence - Array - Easy - LeetCode

Given an unsorted array of integers, find the length of the longest continuous increasing subsequence (subarray). Exampl…

1 min26 Sept
Maximum Average Subarray I - Array - Easy - LeetCode

Maximum Average Subarray I - Array - Easy - LeetCode

Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average val…

1 min26 Sept
Non-decreasing Array - Array - Easy - LeetCode

Non-decreasing Array - Array - Easy - LeetCode

Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most 1 elem…

2 min26 Sept
Blog β€” Page 21 | AskGif