Everyone on Blind talking about Leetcode hards. Are they the new norm in interviewing? When I interviewed they were rare, but seem to be discussed more now. If they really the norm then fuuuck I ain't ever leaving Amazon willingly. Fuck the very idea of grinding leetcode hard.
Many medium question have optimized answer. Sadly a good or not perfect time complexity leads to tle. So, Lc expects questions perfect answers leading converting medium into hard. Lc q 456- 132 pattern.. There is https://www.cnblogs.com/grandyang/p/6081984.html . Naive answer with 3 loop makes it easy. Improved version with 2 loop (w/wo extra space) makes it medium. Stack answer with o(n) makes it hard. If you don’t give stack answer, it won’t be accepted or you will get tle.