Leetcode - 392. Is Subsequence
此篇文章為我的解題紀錄,程式碼或許並不是很完善
Leetcode - 392. Is Subsequence
解題思路
跑迴圈在s的每個字元裡找t是否有相對應的字元,若是有找到,下一次進迴圈時從上次找到的位置再加一的index開始找,若是途中無找到,則即刻回傳
我滴程式碼
1 | class Solution: |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GitalkFacebook Comments