Maximum Sum with Tiles

Problem Overview

  • Given an array A of N integers, choose up to three tiles to maximize the sum of covered values.
  • Each tile covers exactly two adjacent elements; tiles cannot overlap and must stay within the array.
  • Input: array A; Output: integer maximum sum (returned by solution(A)).
  • Context: resource allocation/tile placement to capture the highest total value.
  • From Microsoft interviews; an interview question and coding interview problem centered on optimal selection.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: