Skip to content
← Back to the archive

22 September 2026 · Advanced track

Most Consistent Solar Array

Advanced Dictionaries Lists Numbers

Choose the highest-output solar array, using its reading range to resolve a tie.

A solar field logs array names and energy readings in matching lists. The name and reading at the same position belong to one report. Add all energy readings for each array. Return the array with the largest total energy. If arrays tie for the largest total: - Prefer the array with the smallest difference between its largest and smallest individual readings. - If that is also tied, prefer the array whose first report appears earliest.

Constraints

  • arrays and readings have the same length between 1 and 100000.
  • Every array name is an ASCII string between 1 and 30 characters.
  • Every reading is between 0 and 100000.

Function signature

def most_consistent_array(arrays, readings):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.