Java || BruteForce || N^2
\n# Code\n\nclass Solution {\n    public String shortestBeautifulSubstring(String s, int k) {\n        String ans = "";\n        int len = Integer.MAX_VALUE;\n\
\n# Code\n```\nclass Solution {\n    public String shortestBeautifulSubstring(String s, int k) {\n        String ans = "";\n        int len = Integer.MAX_VALUE;\n\n        for (int i = 0; i < s.length(); i++) {\n            int count = 0;\n            for (int j = i; j < s.length(); j++) {\n                if (s.charAt(j) == \'1\') {\n                    count++;\n                }\n                if (count == k) {\n                    String ss = s.substring(i, j + 1);\n                    if (ss.length() < len || (ss.length() == len && ss.compareTo(ans) < 0)) {\n                        len = ss.length();\n                        ans = ss;\n                    }\n                    break;\n                }\n            }\n        }\n        return ans;\n    }\n}\n```
['Java']