Coding Exercise Posts - page 33 of 43

Recent posts

Linked List Deletion

less than 1 minute read

Given a singly linked list node, and an integer target, return the same linked list with all nodes whose value is target removed.

Line Segment

less than 1 minute read

Given a list of [x, y] coordinates in a Cartesian plane, return whether the coordinates form a straight line segment.

Line of People

1 minute read

You are given integers n, a and b. You are standing in a line of n people. You don’t know which position you’re in, but you know there are at least a people ...

Lexicographically Largest Mountain List

1 minute read

You are given three positive integers n, lower, and upper. You want to create a list of length n that is strictly increasing and then strictly decreasing and...

Lexicographic Swap

less than 1 minute read

Given a string s, return the lexicographically smallest string that can be made if you can make at most one swap between two characters in the string.

Level Order Traversal

less than 1 minute read

Given a binary tree root return a level order traversal of the node values.

Level Order Alternating

less than 1 minute read

Given a binary tree root, return values of the nodes in each level, alternating from going left-to-right and right-to-left.

Length of a Linked List

less than 1 minute read

Given a singly linked list node, return its length. The linked list has fields next and val.

Leftmost Deepest Tree Node

less than 1 minute read

Given a binary tree root, find the value of the deepest node. If there’s more than one deepest node, then return the leftmost one.

Left Side View of a Tree

less than 1 minute read

Given a binary tree root, return the leftmost node’s value on each level of the tree.

Leaves in Same Level

less than 1 minute read

Given a binary tree root, return whether all leaves are at the same level.