Cognizant, Online Assessments in 03 Jun, 2025 | Tall Buildings Sum | Array Indexing | Cognizant On-campus 2025 | OA 2025
Cognizant · Question · Posted Mar 2026
Question 1: Tall Buildings Sum Problem Statement: You are given an integer array H representing the heights of N buildings on a street, and an integer value D. A building at index i is considered tall if its height is strictly greater than the heights of the buildings at indices (i - D) and (i + d) (if those indices exist). If neither or any one of these indices exists, the building is still considered tall. Your task is to ...
The full answer & interview discussion are available to premium members.
Log in Create a free account