Specification/Rules of problem:
- Find the index of the first occurrence of an arbitrary length substring within a string.
- Use what ever language you prefer.
- Must be done at the character/int/byte level.
- No Regex or String functions may be used apart from charAt/getBytes/getCharArray etc equivalent functions ie functions for retrieving the characters in whatever form.
My solution in Java: