Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding _1081.java #166

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add files via upload
sushant-sinha authored Aug 10, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e301bdbcb530ed1875e139fd00690ed770e989a1
21 changes: 21 additions & 0 deletions 1961. Check If String Is a Prefix of Array.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.fishercoder.solutions;

public class _1961{

public class Solution1 {
public boolean isPrefixString(String s, String[] words) {

String t="";
int i=0;

while(t.length()<s.length() && i<words.length){
t+=words[i++];

if(t.equals(s))
return true;
}

return false;

}
}