package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/can-make-palindrome-from-substring/
 */
public class Problem1177 {
    public List<Boolean> canMakePaliQueries(String s, int[][] queries) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1177 prob = new Problem1177();
        System.out.println(prob.canMakePaliQueries("abcda", new int[][]{
            {3,3,0},{1,2,0},{0,3,1},{0,3,2},{0,4,1}
        })); // [true,false,false,true,true]
    }
}

@@ -12,16 +12,44 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -253,35 +253,520 @@
     
-// TODO%0A        return null
+List%3CBoolean%3E answer = new ArrayList%3C%3E();%0A        for (int%5B%5D query : queries) %7B%0A            String sub = s.substring(query%5B0%5D, query%5B1%5D + 1);%0A            int count = 0;%0A            for (int i = 0, j = sub.length() - 1; i %3C j; i++, j--) %7B%0A                if (sub.charAt(i) != sub.charAt(j)) %7B%0A                    count++;%0A                %7D%0A                if (count %3E query%5B2%5D) %7B%0A                    break;%0A                %7D%0A            %7D%0A            answer.add(count %3C= query%5B2%5D);%0A        %7D%0A        return answer
 ;%0A  
@@ -857,24 +857,26 @@
 blem1177();%0A
+//
         Syst
@@ -936,16 +936,18 @@
 nt%5B%5D%5B%5D%7B%0A
+//
         
@@ -990,16 +990,18 @@
 %7B0,4,1%7D%0A
+//
         
@@ -1037,16 +1037,290 @@
 e,true%5D%0A
+        System.out.println(prob.canMakePaliQueries(%22hunu%22, new int%5B%5D%5B%5D%7B%0A            %7B1,1,1%7D,%7B2,3,0%7D,%7B3,3,1%7D,%7B0,3,2%7D,%7B1,3,3%7D,%7B2,3,1%7D,%7B3,3,1%7D,%7B0,3,0%7D,%7B1,1,1%7D,%7B2,3,0%7D,%7B3,3,1%7D,%7B0,3,1%7D,%7B1,1,1%7D%0A        %7D)); // %5Btrue,false,true,true,true,true,true,false,true,false,true,true,true%5D%0A
     %7D%0A%7D%0A

Update problem 1177