|
|
|
|
|
by poikniok
3348 days ago
|
|
A Monotone Priority Queue is neither sufficient nor needed to solve this problem (as it does not give a linear time solution). Instead the proper solution just needs a deque, see http://techieme.in/maximum-element-sliding-window/. So yes as you can see knowing algorithms is important, as if you don't you will attempt to use an overly complicated data structure to come up with a suboptimal solution. |
|