leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

2486.cpp (239B)


      1 class Solution {
      2   public:
      3     int appendCharacters(const string &s, const string &t) {
      4         int j = 0;
      5         for (int i = 0; i < s.size() && j < t.size(); i++)
      6             if (s[i] == t[j]) j++;
      7         return t.size() - j;
      8     }
      9 };