Implement merge sort and largest 1-rectangle
Two SigmaData Scientist · Technical ScreenLast updated
This question evaluates proficiency in implementing and analyzing classic algorithms, specifically merge sort for array sorting and techniques for computing the largest all-ones rectangular submatrix in a binary matrix, testing algorithmic thinking, data structure manipulation, and time/space complexity reasoning.
The coding round included two algorithm questions:
- Implement merge sort for an array of integers. Return the sorted array and explain its time and space complexity.
- Given an
m x nbinary matrix containing only0and1, find the area of the largest rectangular submatrix consisting entirely of1s.
Assume standard input sizes and focus on correctness and efficiency.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.