Microsoft interview question

Stock and buy question of leetcode, maximum matrix size with all one. The question was based on stack implementation using an array, linked list, and all the follow-up questions.