ED is hard to think for first time; ZigZag traversal is easy
only came up with an TLE solution, the Aced solution is so so smart!