Search
⌘K

Leetcode 2675. Array of Objects to Matrix

Convert an array of objects into a 2D matrix by extracting a header row of all unique keys (in a specified order) and aligning each object's values into subsequent rows under the corresponding columns, inserting placeholders for missing keys. The challenge is to efficiently collect and order keys, map them to column indices, and populate the matrix for potentially large inputs while preserving the required column ordering.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid December, 2024

Google

Google

Senior

Matrix problem involving a list of class objects with specific attributes

Comments

Your account is free and you can post anonymously if you choose.