Loading...
Engaged Employer
design an algorithm to decide if a string str1 contains str2
Anonymous
use for loop
//design an algorithm to decide if a string str1 contains str2 bool isSubstring(string str1, string str2) { char firstL = str2[0]; for(int i = 0; i = str1.size() || str1[i] != str2[j]) { valid = false; } } if(valid) { return true; } else { i--; } } } return false; }
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.