Leetcode in Java && Oracle
422 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-10-25_15-37-39.png
29.8 KB
#N1961. Check If String Is a Prefix of Array
problem link=>https://leetcode.com/problems/check-if-string-is-a-prefix-of-array/

#solution
class Solution {
public boolean isPrefixString(String s, String[] words) {
String allWords="";

for(int i=0; i<words.length; i++){
allWords+=words[i];
if(allWords.equals(s))
return true;
}
return false;
}
}