RAZORPAY SDE-1 OA (2022) | Prefix Sum Optimization and Computational Geometry Based Interview Problems
Question · Posted Jun 2026
Q1. Count of Range Sum Problem Statement Given an integer array nums and two integers lower and upper, return the number of range sums that lie within the inclusive range: [lower, upper] A range sum S(i, j) is defined as: nums[i] + nums[i+1] + ... + nums[j] where: 0 <= i <= j < n Example 1 Input nums = [-2,5,-1] lower = -2 upper = 2 Output 3 Explanation Valid range sums: [-2] = -2 [-1] ...
The full answer & interview discussion are available to premium members.
Log in Create a free account