[Swift] Accepted solution ✅
\n\n# Code\n\nclass Solution {\nfunc shortestBeautifulSubstring(_ s: String, _ k: Int) -> String {\n\tguard s.contains("1") && k > 0 else { return "" }\n\tlet s
\n\n# Code\n```\nclass Solution {\nfunc shortestBeautifulSubstring(_ s: String, _ k: Int) -> String {\n\tguard s.contains("1") && k > 0 else { return "" }\n\tlet sArray = Array(s)\n\tvar ans = s\n\tvar queue: [Int] = []\n\n\tfor (i, char) in sArray.enumerated() where char == "1" {\n\t\tqueue.append(i)\n\t}\n\n\tif queue.count < k { return "" }\n\n\twhile queue.count >= k, let firstIndex = queue.first {\n\t\tlet curr = String(sArray[firstIndex...queue[k-1]])\n\t\tif Double(curr)! <= Double(ans)! {\n\t\t\tans = curr\n\t\t}\n\t\tqueue.removeFirst()\n\t}\n\treturn ans\n}\n}\n```
['Swift']