Media.net | Virtual Onsite
Anonymous User
890

Given an array of size n+1 such that arr[i] = i.
Given Q queries (Q<n) with condition:

  1. Given i : Update arr[i]=0
  2. Given (L, R) : Return max element in range (L,R)

Follow up: Consider the case where n is very large

Comments (2)