結果 : monotonic stack python implementation