LeetCode 28. Implement strStr()
2022.07.18

問題

typescript

typescript

function strStr(haystack: string, needle: string): number {
  if (needle === '') return 0
  return haystack.indexOf(needle)
};