Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Transform a 1D integer array into a 2D binary matrix.
Each row represents an input element with a single 1 at its corresponding column.
Columns are ordered by the sorted unique values present in the array.
What This Tests
Hash table for efficient value-to-index mapping
Sorting and deduplication of elements
Matrix initialization and indexed assignment
Handling arbitrary integer ranges
Common Patterns
Hashing
Sorting
Array Manipulation
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected