Coding Exercise Posts - page 31 of 43

Recent posts

Maximum Number by Inserting Five

less than 1 minute read

Given an integer n, return the maximum number you can make by inserting 5 anywhere in the number.

Maximize Social Distancing

1 minute read

You are given a list of integers seats containing 1s and 0s. Each element seats[i] represents a seat and is either occupied if seats[i] = 1 or empty if seats...

Max Product of Two Numbers

1 minute read

Given a list of integers nums, find the largest product of two distinct elements.

Max Product of Three Numbers

less than 1 minute read

Given a list of integers nums, find the largest product of three distinct elements.

Matrix Prefix Sum

less than 1 minute read

Given a two-dimensional integer matrix, return a new matrix A of the same dimensions where each element is set to A[i][j] = sum(matrix[r][c]) for all r ≤ i, ...

Making List Values Equal

1 minute read

You are given a list of integers nums. Consider an operation where we select some subset of integers in the list and increment all of them by one.

Longest Sign Alternating Subsequence

less than 1 minute read

Given a list of non-zero integers nums, return the length of longest subsequence that flips signs on each consecutive number.

Longest Interval Containing One Number

1 minute read

You are given a list of unique integers nums. Return the size of the largest inclusive interval [start, end] such that it contains exactly one number in nums.

Longest Increasing Subsequence

less than 1 minute read

Given an unsorted list of integers nums, return the longest strictly increasing subsequence of the array.