์ฝ๋ฉํ
์คํธ/LeetCode
2022. 6. 25.
[LeetCode] Non-decreasing Array
๋ฌธ์ ๋งํฌ Non-decreasing Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com ์ฃผ์ด์ง ๋ฐฐ์ด์์ ํ๋์ ์ซ์๋ง ๋ณ๊ฒฝํ์ฌ ์ค๋ฆ์ฐจ์์ ๋ง๋ค ์ ์๋์ง ๋ฌป๋ ๋ฌธ์ ์ด๋ค. ์ ๊ทผ ๋ฐฉ๋ฒ ์ฒ์์๋ ์ ๋ค ์ซ์๋ง ๋น๊ตํ๋ ๋ฐฉ์์ผ๋ก ์ ๊ทผํ์์ง๋ง ๊ณง 3๊ฐ์ ์๋ฅผ ๋น๊ตํด์ผํ๋ค๋ ๊ฒ์ ๊นจ๋ฌ์๋ค. (2, 3, 4, 8, 3, 4, 5) => nums[i-1] > num[i] ์ธ ๊ตฌ๊ฐ์ด 1๊ฐ์ด์ง๋ง ์ ๋ต์ผ ์ ์์ (1, 2, 50, 3) => 50์ ์ค์ด๊ฑฐ๋ 3์ ํค์์ผํจ..