Predict the Winner
-
LeetCode_486. Predict the Winner알고리즘/Leetcode 2020. 12. 18. 13:45
leetcode.com/problems/predict-the-winner/ Predict the Winner - 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 Solution1. 2차원 배열을 이용하여 [start, end] 구간에서의 점수 차를 저장 즉, DP[start][end] >= 0 : win 을 의미하고 DP[start][end] < 0 : Lose 를 의미 if start == end : dp[start][end] = nums[start] else ..