Media.net 2026-January | Segment Trees | On-campus

Question · Posted Jun 2026

Question 1: Maximum Subarray Sum Queries Problem Statement You are given an array A of N integers. You are also given Q queries. Each query consists of two integers L and R. For each query, you must find the maximum contiguous subarray sum entirely contained within the range [L, R]. Input Format The first line contains a single integer N - the size of the array. The second line contains N space-separated integers representing the array A. The third line ...

The full answer & interview discussion are available to premium members.

Log in Create a free account