
🔍 LeetCode 28번 - Find the Index of the First Occurrence in a String (TypeScript)LeetCode 28번 문제는 문자열 검색 알고리즘을 활용하여 특정 문자열(needle)이 다른 문자열(haystack) 내에서 처음 등장하는 위치를 찾는 문제입니다.이 글에서는 여러 가지 알고리즘을 사용하여 TypeScript로 해결하는 방법을 설명합니다.1️⃣ Brute Force (기본 구현) - O(N*M)가장 단순한 방법은 Brute Force (완전 탐색) 방식으로, haystack을 순차적으로 검사하며 needle과 일치하는 부분을 찾습니다.export function strStr(haystack: string, needle: string): num..