Coding Exercise Posts - page 13 of 43

Recent posts

Max Sum of Two Non-Overlapping Lists

less than 1 minute read

Given a list of integers nums and integers a and b, return the max sum of two non-overlapping sublists in nums which have lengths a and b.

Lowest Common Ancestor

less than 1 minute read

Given a binary tree root, and integers a and b, find the value of the lowest node that has a and b as descendants. A node can be a descendant of itself.

Longest Interval

less than 1 minute read

You are given a two-dimensional list of integers intervals where each list represents an inclusive [start, end] interval. Return the longest interval that yo...

Linked List Folding

1 minute read

You are given a singly linked list node containing integer values. Take the first half of the linked list and fold over the second half and merge the interse...

Largest Tree Sum Path

less than 1 minute read

Given a binary tree root, return the largest sum of any path between any two nodes.

Largest Sum of 3 Non-Overlapping Sublists

less than 1 minute read

Given a list of integers nums and an integer k, return the largest sum of three non-overlapping sublists of nums each of size k.

Largest and Smallest Difference

less than 1 minute read

Given a list of integers nums and an integer k, choose elements from nums to create a list of length k such that the difference between the largest integer i...

Island Shape Perimeter

less than 1 minute read

Given a two-dimensional integer matrix of 1s and 0s where 0 represents empty cell and 1 represents a block that forms a shape, return the perimeter of the sh...

Interval Union

less than 1 minute read

Given a two-dimensional integer list intervals representing unsorted inclusive intervals, return their union in sorted order.

Interval Duration

less than 1 minute read

You are given a two-dimensional list of integers intervals where each list represents an inclusive [start, end] interval.

Delete Repeated Characters with Costs

less than 1 minute read

You are given a lowercase alphabet string s and a list of non-negative integers costs, both of which have the same length. You can remove character s[i] for ...

Conway’s Game of Life

1 minute read

You are given a two dimensional matrix where a 1 represents a live cell and a 0 represents a dead cell. A cell’s (living or dead) neighbors are its immediate...