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 Subsequence in Non-Increasing Order - Greedy - Easy - LeetCode
Featured

Minimum Subsequence in Non-Increasing Order - Greedy - Easy - LeetCode

Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such subsequence.  If there are multiple solutions,

1 min read5 Oct 2020
Read article
Maximize Sum Of Array After K Negations - Greedy - Easy - LeetCode

Maximize Sum Of Array After K Negations - Greedy - Easy - LeetCode

Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i] with -A[i],

1 min5 Oct
Delete Columns to Make Sorted - Greedy - Easy - LeetCode

Delete Columns to Make Sorted - Greedy - Easy - LeetCode

We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion in

1 min5 Oct
Walking Robot Simulation - Greedy - Easy - LeetCode

Walking Robot Simulation - Greedy - Easy - LeetCode

A robot on an infinite grid starts at point (0, 0) and faces north.  The robot can receive one of three possible ty

2 min5 Oct
Lemonade Change - Greedy - Easy - LeetCode

Lemonade Change - Greedy - Easy - LeetCode

At a lemonade stand, each lemonade costs $5.  Customers are standing in a queue to buy from you, and order one at a

1 min5 Oct
Assign Cookies - Greedy - Easy - LeetCode

Assign Cookies - Greedy - Easy - LeetCode

Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most on

1 min5 Oct
Last Stone Weight - Heap - Easy - LeetCode

Last Stone Weight - Heap - Easy - LeetCode

We have a collection of stones, each stone has a positive integer weight. Each turn, we choose the two heaviest stones a

2 min4 Oct
Kth Largest Element in a Stream - Heap - Easy - LeetCode

Kth Largest Element in a Stream - Heap - Easy - LeetCode

Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order,

1 min4 Oct
Crawler Log Folder - Stacks - Easy - LeetCode

Crawler Log Folder - Stacks - Easy - LeetCode

The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are describe

1 min3 Oct
Build an Array With Stack Operations - Stacks - Easy - LeetCode

Build an Array With Stack Operations - Stacks - Easy - LeetCode

Given an array target and an integer n. In each iteration, you will read a number from  list = {1,2,3..., n}. Build

1 min3 Oct
Remove All Adjacent Duplicates In String - Stacks - Easy - LeetCode

Remove All Adjacent Duplicates In String - Stacks - Easy - LeetCode

Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and remo

1 min3 Oct
Remove Outermost Parentheses - Stacks - Easy - LeetCode

Remove Outermost Parentheses - Stacks - Easy - LeetCode

A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strings, a

1 min3 Oct
Baseball Game - Stacks - Easy - LeetCode

Baseball Game - Stacks - Easy - LeetCode

You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Int

2 min3 Oct
Next Greater Element I - Stacks - Easy - LeetCode

Next Greater Element I - Stacks - Easy - LeetCode

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all

1 min3 Oct
Implement Queue using Stacks - Stack - Easy - LeetCode

Implement Queue using Stacks - Stack - Easy - LeetCode

Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of the queue.pop() --

2 min3 Oct