NeetCode #290LC-2070MediumBinary Search
← Back to All Problems#290 · #2070 · Most Beautiful Item for Each Query(每一个查询的最大美丽值)
📌 Problem Statement & Constraints
You are given a 2D array
items where items[i] = [price_i, beauty_i], and an array of queries. For each query, return the maximum beauty among all items with price at most that query. If no such item exists, return 0. Constraints: 1 <= items.length, queries.length <= 10^5, 1 <= price, beauty, query <= 10^9.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!