package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/partition-labels/
 */
public class Problem763 {
    public List<Integer> partitionLabels(String S) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem763 prob = new Problem763();
        System.out.println(prob.partitionLabels("ababcbacadefegdehijhklij")); // [9,7,8]
    }
}

@@ -33,13 +33,89 @@
 til.
+Array
 List;
+%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;
 %0A%0A/*
@@ -262,35 +262,1375 @@
     
-// TODO%0A        return null
+List%3CMap%3CCharacter, Integer%3E%3E list = new ArrayList%3C%3E();%0A        list.add(new HashMap%3C%3E());%0A        for (int i = 0; i %3C S.length(); i++) %7B%0A            char c = S.charAt(i);%0A            for (int j = 0; j %3C list.size(); j++) %7B%0A                Map%3CCharacter, Integer%3E map = list.get(j);%0A                if (map.containsKey(c)) %7B%0A                    map.put(c, map.get(c) + 1);%0A                    int size = list.size();%0A                    for (int k = size - 1; k %3E= j + 1; k--) %7B%0A                        Map%3CCharacter, Integer%3E map2 = list.get(k);%0A                        map2.forEach((key, value) -%3E %7B%0A                            if (map.containsKey(key)) %7B%0A                                map.put(key, map.get(key) + value);%0A                            %7D%0A                        %7D);%0A                        list.remove(k);%0A                    %7D%0A                    break;%0A                %7D else %7B%0A                    Map%3CCharacter, Integer%3E newMap = new HashMap%3C%3E();%0A                    newMap.put(c, 1);%0A                    list.add(newMap);%0A                %7D%0A            %7D%0A        %7D%0A        List%3CInteger%3E result = new ArrayList%3C%3E();%0A        for (Map%3CCharacter, Integer%3E map : list) %7B%0A            int total = 0;%0A            for (int value : map.values()) %7B%0A                total += value;%0A            %7D%0A            result.add(total);%0A        %7D%0A        return result
 ;%0A  

Update problem 763