문제 Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. 문자열이 주어지면, 그 문자열의 부분 문자열이 원본 문자열을 여러 개로 구성할 수 있는지 판별하여 true, false를 반환하시오. 예시 ample 1: Input: s = "abab" Output: true Explanation: It is the substring "ab" twice. Example 2: Input: s = "aba" Output: false Example 3: Input: s = "abcabcabcabc" Output: true Explan..
문제 Implement strStr(). Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What should we return when needle is an empty string? This is a great question to ask during an interview. For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's s..
Comment