[
array
simulation
greedy
]
BinarySearch 0982 First Fit Room
Problem statement
https://binarysearch.com/problems/First-Fit-Room/
Solution
Just do what is asked.
Complexity
It is O(n)
for time and O(1)
for space.
Code
class Solution:
def solve(self, A, target):
for x in A:
if x >= target: return x
return -1