JAVA_DI String Match_LeetCode 942


JAVA_DI String Match_LeetCode 942

JAVA_DI String Match_LeetCode 942 풀이 class Solution { public int[] diStringMatch(String s) { int n = s.length(), leftVal = 0, rightVal = n; int[] res = new int[n+1]; for (int i = 0; i < n; i++) res[i] = s.charAt(i) == 'I' ? leftVal++ : rightVal--; res[n] = leftVal; return res; } } * 출처 https://leetcode.com/problems/di-string-match/ DI String Match - LeetCode Can you solve this real interview question? DI String Match - A permutation perm of n + 1 integers of all the integers in the range [0, n] ...


#DIStringMatch_LeetCode942 #JAVA #JAVA_DIStringMatch #JAVA_DIStringMatch_LeetCode942 #JAVA_LeetCode942

원문링크 : JAVA_DI String Match_LeetCode 942