Google | Phone | Largest Land Under Budget
Anonymous User
3222

Question 1:
Given a list of land plots with their prices and a maximum budget, find the size of largest contiguous plot of land you can purchase under the given budget.

Example:

Input: [1, 1, 3, 2, 4, 3, 2], budget = 7
Output: 4
Explanation: [1, 1, 3, 2]

Question 2:
Given a 2D array representing a 2D plot of land, find the maximum side length of a square plot of land under the budget.

Example:

Input:
[[1, 1, 3, 2, 4, 3, 2]
 [1, 1, 3, 2, 4, 3, 2]
 [1, 1, 3, 2, 4, 3, 2]]
budget = 4

Output: 2
Explanation:
[[1, 1],
 [1, 1]]
Comments (12)