<p>Given two strings <code>s</code> and <code>t</code>, return <code>true</code> if <code>t</code> is an <span data-keyword="anagram">anagram</span> of <code>s</code>, and <code>false</code> otherwise.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;anagram&quot;, t = &quot;nagaram&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">true</span></p>
</div>

<p><strong class="example">Example 2:</strong></p>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;rat&quot;, t = &quot;car&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">false</span></p>
</div>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s.length, t.length &lt;= 5 * 10<sup>4</sup></code></li>
	<li><code>s</code> and <code>t</code> consist of lowercase English letters.</li>
</ul>

<p>&nbsp;</p>
<p><strong>Follow up:</strong> What if the inputs contain Unicode characters? How would you adapt your solution to such a case?</p>

class Solution {
public:
    bool isAnagram(std::string s, std::string t) {
        std::vector<char> s1(s.begin(), s.end());
        std::vector<char> t1(t.begin(), t.end());

        int slength = s1.size();
        int tlength = t1.size();

        if (slength!=tlength) return false;

        int i = 0;
        for (int j = 0; j <= tlength; j++){
            if(i < slength && j < t1.size() && s1[i] == t1[j]){
                i++;
                t1.erase(t1.begin() + j);
                j=-1;
                if ( i >= slength) return true;
            }
        }
        return false;
    }
};

9100