시뮬레이션보다 불변조건을 찾아야 한다2026.08.16algorithmleetcodeinvarianttwo-pointerLeetCode 2337 문제를 통해 이동 과정을 구현하는 대신 변하지 않는 조건을 찾아 문제를 해결한 과정을 정리한다.