Кизин Кирилл, 118 группа SubString 12862
Юань Дунлян, 523 Группа SubString 13306
f1import collectionsf1import collections
22
3class SubString(collections.UserString):3class SubString(collections.UserString):
44
5    def __sub__(self, other):5    def __sub__(self, other):
6        import collections6        import collections
n7        cl = collections.Counter(self)n7        left_counter = collections.Counter(self)
8        cr = collections.Counter(other)8        right_counter = collections.Counter(other)
9        ans_str = ''9        result_str = ''
10        for ch in self.data:10        for char in self:
11            if cl[ch] > 0 and cr[ch] > 0:11            if left_counter[char] > 0 and right_counter[char] > 0:
12                cl[ch] -= 1
13                cr[ch] -= 112                left_counter[char] -= 1
13                right_counter[char] -= 1
14            else:14            else:
n15                ans_str += chn15                result_str += char
16        del collections16        del collections
t17        return self.__class__(ans_str)t17        return self.__class__(result_str)
18del collections18del collections
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op