Coding Exercise Posts - page 34 of 43

Recent posts

Leaf Equivalent Trees

less than 1 minute read

Given two binary trees root0 and root1, return whether the sequence of leaves left-to-right in both trees are the same.

Leaderboard

less than 1 minute read

You are given a list of integers nums, representing the number of chess matches each person has won. Return a relative ranking (0-indexed) of each person. If...

Latin Square

1 minute read

Given an n by n matrix of letters matrix, return whether there are exactly n different letters that appear in the matrix and each letter appears exactly once...

Largest Sum of Non-Adjacent Numbers

1 minute read

Given a list of integers nums, write a function that returns the largest sum of non-adjacent numbers. Numbers can be 0 or negative.

Largest Sum After K Negations

1 minute read

You are given a list of integers nums and an integer k. Consider an operation where you pick an element in nums and negate it. Given that you must make exact...

Largest Number By Two Times

1 minute read

Given a list of integers nums, return whether the largest number is bigger than the second-largest number by more than two times.

Largest Gap

less than 1 minute read

Given a list of integers nums, return the largest difference of two consecutive integers in the sorted version of nums.

Large to Small Sort

less than 1 minute read

Given a list of integers nums, sort the list in the following way:

Kth Smallest in a Binary Search Tree

less than 1 minute read

Given a binary search tree root, and k return the kth (0-indexed) smallest value in root. It is guaranteed that the tree has at least k + 1 nodes.

Kth Smallest Element

less than 1 minute read

Given a list of unsorted integers nums, and an integer k, return the kth (0-indexed) smallest element in the list.

Kth Missing Number

less than 1 minute read

Given a list of sorted unique integers nums and an integer k, return the kth (0-indexed) missing number from the first element of the list.