package leetcode;

/**
 * https://leetcode.com/problems/construct-k-palindrome-strings/
 */
public class Problem1400 {
    public boolean canConstruct(String s, int k) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1400 prob = new Problem1400();
        System.out.println(prob.canConstruct("annabelle", 2)); // true
        System.out.println(prob.canConstruct("leetcode", 3)); // false
        System.out.println(prob.canConstruct("true", 4)); // true
        System.out.println(prob.canConstruct("yzyzyzyzyzyzyzy", 2)); // true
        System.out.println(prob.canConstruct("cr", 7)); // false
    }
}

@@ -12,16 +12,65 @@
 tcode;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 /**%0A * h
@@ -224,485 +224,437 @@
     
-// TODO%0A        return false;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1400 prob = new Problem1400();%0A        System.out.println(prob.canConstruct(%22annabelle%22, 2)); // true%0A        System.out.println(prob.canConstruct(%22leetcode%22, 3)); // false%0A        System.out.println(prob.canConstruct(%22true%22, 4)); // true%0A        System.out.println(prob.canConstruct(%22yzyzyzyzyzyzyzy%22, 2)); // true%0A        System.out.println(prob.canConstruct(%22cr%22, 7)); // false
+if (k %3E s.length()) %7B%0A            return false;%0A        %7D%0A        Map%3CCharacter, Integer%3E map = new HashMap%3C%3E();%0A        for (char c : s.toCharArray()) %7B%0A            map.put(c, map.getOrDefault(c, 0) + 1);%0A        %7D%0A        int oddCount = 0;%0A        for (Map.Entry%3CCharacter, Integer%3E e : map.entrySet()) %7B%0A            if (e.getValue() %25 2 != 0) %7B%0A                oddCount++;%0A            %7D%0A        %7D%0A        return oddCount %3C= k;
 %0A   

Solve problem 1400