s02220725 SubString 6349
Тулинова Олеся Вадимовна, 442 группа SubString 6741
t1class SubString(__import__('collections').UserString):t1class SubString(__import__('collections').UserString):
22
3    def __sub__(self, other):3    def __sub__(self, other):
4        if not isinstance(other, (str, SubString)):4        if not isinstance(other, (str, SubString)):
5            return NotImplemented5            return NotImplemented
6        Counter = __import__('collections').Counter6        Counter = __import__('collections').Counter
7        counter = Counter(other)7        counter = Counter(other)
8        result_chars = []8        result_chars = []
9        for ch in self.data:9        for ch in self.data:
10            if counter[ch] > 0:10            if counter[ch] > 0:
11                counter[ch] -= 111                counter[ch] -= 1
12            else:12            else:
13                result_chars.append(ch)13                result_chars.append(ch)
14        return SubString(''.join(result_chars))14        return SubString(''.join(result_chars))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op