Coding Exercise Posts - page 3 of 43

Recent posts

Bitwise AND of Range of Numbers

less than 1 minute read

Given two integers start and end, return the bitwise AND of all numbers in [start, end], inclusive.

Decode List Message

1 minute read

You are given a string s containing digits from 0 - 9 and an integer k. Return the number of different ways that s could represent a list of numbers from [1,...

Minimum Window Substring

less than 1 minute read

Given two lowercase alphabet strings a and b, return the length of a minimum substring in a that contains all the characters of b.

Sort by Permutation

less than 1 minute read

Given a list of strings lst and a list of integers p, reorder lst so that every lst[i] gets placed to p[i].

Dividing Station

1 minute read

Given a list of distinct positive integers nums, find the largest subset such that every pair of elements in the subset (i, j) satisfies either i % j = 0 or ...

Diagonal Sort

less than 1 minute read

Given a two-dimensional integer matrix, sort each of the diagonals descending from left to right in ascending order.

String Expansion

less than 1 minute read

You are given a string s consisting of lowercase alphabet characters, digits, and brackets"(" and ")". s encodes a longer string and is represented as concat...

Multiset Sum

less than 1 minute read

Given a list of unique positive integers nums and a positive integer k, return the number of unique combinations that sum up to k. You may reuse numbers when...

Rotate a Box Under Gravity

1 minute read

You are given a two-dimensional list of strings matrix. Each element in matrix contains one of the following:

Count Submatrices That Sum Target

less than 1 minute read

You are given a two-dimensional integer matrix and an integer target. Return the number of submatrices in matrix whose sum equals target.

Linked List Partitioning

less than 1 minute read

You are given a singly linked list node and an integer k. Order the linked list so that all nodes whose values are less than k come first, all nodes whose va...

Meeting Schedule For Two People

1 minute read

You are given two two-dimensional list of integers a and b and an integer duration. Each element in a contains an inclusive interval [start, end] meaning tha...