Introduction
It is a medium level algorithm. I spent 52 minutes to solve the problem. I need to look into the issue how to expedite my problem solving.
Think about all possible options
What I do is to find left child subarray start and end position, same as right child's start and end position.
What I calculate in the contest is the last index of left child subarray.
Here is the another idea to calculate the last index of left child. I saw the discussion link.
No comments:
Post a Comment