Coding Exercise Posts - page 5 of 43

Recent posts

Shipping and Receiving

1 minute read

You are given a two-dimensional list of integers ports where ports[i] represents the list of ports that port i is connected to. You are also given another tw...

Sum of Four Numbers

1 minute read

Given a list of integers nums and an integer k, return whether there are four distinct elements in the list that add up to k.

Edit Distance

1 minute read

Given two strings a and b, find the minimum edit distance between the two. One edit distance is defined as

Odd Palindrome

less than 1 minute read

Given a string s, return whether all its palindromic substrings have odd lengths.

Maximum Absolute Value of Sublist

less than 1 minute read

You are given a list of integers nums. Return the maximum possible abs(nums[i] + nums[i + 1] + ... + nums[j]) for any i <= j.

Unique String Frequencies

less than 1 minute read

Given a lowercase alphabet string s, return the minimum number of characters that we need to delete such that the frequency of each character occurs a unique...

Log Truncation

1 minute read

You are given a list of integers logs and an integer limit. Each element in logs[i] represents the size of logs generated by user i. limit represents the tot...

Labyrinthian Possibilities

2 minute read

You are given an N by M matrix of 0s and 1s. Starting from the top left corner, how many ways are there to reach the bottom right corner? Mod the result by 1...

List Partitioning with Inequality Relation

less than 1 minute read

Given a list of integers nums, we want to split the list into two non-empty sublists a and b such that every element in a is less than or equal to every elem...

Maximum Unique Sublist Sum

less than 1 minute read

You are given a list of non-negative integers nums. Return the maximum sum of a sublist in nums containing only unique values.

Next Integer Permutation

less than 1 minute read

Given an integer n, return the next bigger permutation of its digits.