@@ -0,0 +1,755 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/check-if-string-is-a-prefix-of-array/%0A */%0Apublic class Problem1961 %7B%0A    public boolean isPrefixString(String s, String%5B%5D words) %7B%0A        String prefix1 = %22%22;%0A        int prefix2Index = 0;%0A        for (String word : words) %7B%0A            prefix1 += word;%0A            if (prefix2Index + word.length() %3E s.length()) %7B%0A                return false;%0A            %7D%0A            String prefix2 = s.substring(0, prefix2Index + word.length());%0A            prefix2Index += word.length();%0A            if (!prefix1.equals(prefix2)) %7B%0A                return false;%0A            %7D%0A            if (prefix2.length() == s.length()) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Solve problem 1961