#include<iostream>
#include<stdlib.h>
#include<string.h>
using namespace std;
class Solution
{
public:
char *strFind(char * string, char *substring)
{
if (string == NULL &&substring == NULL)
return NULL;
int m = strlen(string);
int n = strlen(substring);
int j;
if (m < n)
return NULL;
for (int i = 0; i <= m - n; i++)
{
for (j = 0; j <= m - n; j++)
{
if (string[i + j] != substring[j])
break;
}
if (j == n)
return string + i;
}
}
};
int main()
{
char *string = "ababcabcacbab";
char *substring = "abcac";
Solution S1;
cout<<S1.strFind(string, substring)<<endl;
}