기본적인 알고리즘 문제좀 여쭤 볼께요 (Time limit error)