JAVA_Positions of Large Groups_LeetCode 830


JAVA_Positions of Large Groups_LeetCode 830

JAVA_Positions of Large Groups_LeetCode 830 풀이 class Solution { public List<List<Integer>> largeGroupPositions(String s) { List<List<Integer>> res = new ArrayList<>(); int start = 0, n = s.length(); for(int i = 1;i <= n;i++){ if((i == n) || !(s.charAt(i) == s.charAt(i-1))){ if((i - start >= 3)) res.add(List.of(start,(i - 1))); start = i; } } return res; } } * 출처 Positions of Large Groups - LeetCode Can you solve this real interview question? Positions of Large Groups - In a string s of lowercase...


#JAVA #JAVA_LeetCode830 #JAVA_PositionsofLargeGroups #JAVA_PositionsofLargeGroups_LeetCode830 #PositionsofLargeGroups_LeetCode830

원문링크 : JAVA_Positions of Large Groups_LeetCode 830