<s>[INST] class Solution {
public:
    bool isSubsequence(string s, string t) {
        if (s.size() > t.size()) return false;

        int sIndex = 0, tIndex = 0;

        while (sIndex < s.size() && tIndex < t.size()) {
            if (s[sIndex] == t[tIndex]) {
                sIndex++;
            }
            tIndex++;
        }

        return sIndex == s.size();
    }
};
But this solution has a time complexity of O(n) where n is the length of the string t. But I want the time complexity to be O(m + n) where m and n are the lengths of the strings s and t respectively. What should I do to achieve the optimal time complexity?[/INST]