n*m (m is length of first string and n is the length of the other one)
文字列に別の文字列が含まれているかどうかをテストするための時間の複雑さを伴うブルートフォースアプローチは知っていますが、より良い解決策があるかどうか知りたいですか?
boolean contains(String input,String search)
ソースを見ることができます:
public boolean contains(CharSequence s) {
return indexOf(s.toString()) > -1;
}