-
392. Is Subsequence javaLeetCode_Study_Plan/LeetCode 75 2022. 10. 4. 23:16
https://leetcode.com/problems/is-subsequence/
class Solution { public boolean isSubsequence(String s, String t) { String[] s_lt = s.split(""); String[] t_lt = t.split(""); if (s.length() == 0) return true; int index = 0; for(String each_t: t_lt){ if (index == s_lt.length) return true; if(s_lt[index].equals(each_t)){ index++; } } if (index == s_lt.length) return true; return false; } }
'LeetCode_Study_Plan > LeetCode 75' 카테고리의 다른 글
21. Merge Two Sorted Lists java (0) 2022.10.05 206. Reverse Linked List java (0) 2022.10.05 [LeetCode 75] 중간 점검 (0) 2022.10.02 205. Isomorphic Strings java (0) 2022.09.26 724. Find Pivot Index java (1) 2022.09.25