Posts with tag 'binary search'

Eat Bananas in K Hours

1 minute read

You are given a list of integers piles and an integer k. piles[i] represents the number of bananas on pile i. On each hour, you can choose any pile and eat r...

Find the Largest Number in a Rotated List

1 minute read

You are given a list of unique integers nums that is sorted in ascending order and is rotated at some pivot point. Find the maximum number in the rotated list.

Split List to Minimize Largest Sum

less than 1 minute read

Given a list of non-negative integers nums and an integer k, you can split the list into k non-empty sublists.

Skydivers

1 minute read

You are given a list of integers nums where each value represents a group of people looking to skydive together. You are also given k representing the number...

Lowest Sum of Pair Larger than Target

less than 1 minute read

You are given a list of integers nums and an integer target. Return the lowest sum of pair of numbers that is greater than target. You can assume that a solu...

Insertion Index in Sorted List

1 minute read

Given a list of integers nums, sorted in ascending order, and a number target, return the index where target should be inserted to keep nums sorted. If targe...

Guess the Root

less than 1 minute read

Given a non-negative integer n, find a number r such that r * r = n and round down to the nearest integer.

Fixed Point

less than 1 minute read

Given a list of unique integers nums sorted in ascending order, return the minimum i such that nums[i] == i. If there’s no solution, return -1.

Back to top ↑