← All problemsSign in

1253. Reconstruct a 2-Row Binary Matrix

LeetCodeArrayGreedyMatrixOpen on judge ↗

Given the following details of a matrix with n columns and 2 rows : - The matrix is a binary matrix, which means each element in the matrix can be 0 or 1. - The sum of elements of the 0-th(upper) row is given as upper. - The sum of elements of the 1-st(lower) row is given as lower. - The sum of elements in the i-th column(0-indexed) is colsum[i], where colsum is given as an integer array with

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start