結果 : monotonic stack python code