1. 程式人生 > >leetcode-28-Implement strStr()

leetcode-28-Implement strStr()

A clearly problem, just compare the element when element-wise. When the needle pointer get the end, return it. If do not meet at the end, return -1. A stupid point is that the problem treat the needle empty as a valid size, and we can return 0. I think it is unclear and unreasonable.