anikakelhanka
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
thats me
- anikakelhanka June 28, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
public static int searchh(String str1,String target){
int strlen;
int targetlen;
String[] parts1=str1.split("");
String[] parts2=target.split("");
strlen=str1.length();
targetlen=target.length();
int count = 0;
int pos = 0;
for(int i=1;i<=strlen ;i++){
pos=i;
for(int j=1;j<=targetlen && pos<=strlen;j++){
if(parts1[pos].equals(parts2[j])) {
count+=1;
}
pos+=1;
}
if(count==targetlen)
{
return i;
}
else{
count=0;
}
}
return -1;
}
}
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
i liked the answer very much
- anikakelhanka July 03, 2013its a complete answer
thank you