We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using namespace std; class Solution { public: int strStr(string haystack, string needle) { int haystackLen = haystack.length(); int needleLen = needle.length(); if (needleLen == 0) return 0; for (int i = 0; i <= haystackLen - needleLen; i++){ if (haystack.substr(i, needleLen) == needle){ return i; } } return -1; } };
substr
The text was updated successfully, but these errors were encountered:
fkdl0048
No branches or pull requests
substr
함수 사용법 넓히기The text was updated successfully, but these errors were encountered: