diff --git "a/06\354\233\224/2\354\243\274\354\260\250/[LCD] Find the Index of the First Occurrence in a String/Mun.java" "b/06\354\233\224/2\354\243\274\354\260\250/[LCD] Find the Index of the First Occurrence in a String/Mun.java" index 571c4cc..0710cc9 100644 --- "a/06\354\233\224/2\354\243\274\354\260\250/[LCD] Find the Index of the First Occurrence in a String/Mun.java" +++ "b/06\354\233\224/2\354\243\274\354\260\250/[LCD] Find the Index of the First Occurrence in a String/Mun.java" @@ -1,18 +1,20 @@ -class Mun { - public int searchInsert(int[] nums, int target) { - int end = nums.length - 1; - int front = 0; - while(front <= end) { - int mid = (end + front) / 2; - int n = nums[mid]; - if(n > target) { - end = mid - 1; - } else if (n < target) { - front = mid + 1; - } else { - return mid; +class Solution { + public int strStr(String haystack, String needle) { + int len = needle.length(); + + for(int i=0;i=0;i--) { + if(digits[i] < 9) { + digits[i]++; + return digits; + } + digits[i] = 0; + } + int[] ans = new int[digits.length+1]; + ans[0] = 1; + return ans; + } +} \ No newline at end of file