Coding Exercise Posts - page 2 of 43

Recent posts

Shortest Bridge

1 minute read

Given a two-dimensional list of integers matrix containing 0s and 1s, 0 represents water and 1 represents land.

Frequency Stack

1 minute read

Implement a frequency stack with the following methods:

Profitable Job Matching

1 minute read

You are given lists of integers people, jobs, profits. Each person i in people have people[i] amount of strength, and performing job j requires jobs[j] amoun...

Sum of Three Numbers Less than Target

1 minute read

Given a list of integers nums and an integer target, return the number of triples i < j < k that exist such that nums[i] + nums[j] + nums[k] < target.

Deleting Repeated Integers Game

1 minute read

Alice and Bob are playing a game with a sorted list of positive integers nums. In a single turn, Alice selects any three integers. Bob deletes one of them, a...

Maximum Sum Removing K Numbers From Ends

1 minute read

You are given a list of integers nums and integer k. Return the maximum sum of elements that you can remove given that you must pop exactly k times, where ea...

Grammar Rules

1 minute read

Given an integer n, return the number of strings of length n that can be formed under the following rules:

Longest Sublist of 1s After K Sets

less than 1 minute read

You are given a list of integers nums containing 1s and 0s and an integer k. Given that you can set at most k 0s to 1s, return the length of the longest subl...

2048

1 minute read

In the game 2048, you are given a 4 by 4 board of numbers (some of them empty, represented in our case with 0) which you can swipe in any of the 4 directions...

Longest Consecutive Sequence

1 minute read

Given an unsorted array of integers nums, find the length of the longest sequence of consecutive elements.

Wallstreet Bets

less than 1 minute read

You are given a list of non-negative integers prices representing the daily stock prices of a company in chronological order. Return a list of the same lengt...