Return number of occurrences of `value` in the sorted set. Runtime complexity: `O(1)` >>> ss = SortedSet([1, 2, 3, 4, 5]) >>> ss.count(3) 1 :param value: value to count in sorted set :return: count
(self, value)
| 385 | |
| 386 | |
| 387 | def count(self, value): |
| 388 | """Return number of occurrences of `value` in the sorted set. |
| 389 | |
| 390 | Runtime complexity: `O(1)` |
| 391 | |
| 392 | >>> ss = SortedSet([1, 2, 3, 4, 5]) |
| 393 | >>> ss.count(3) |
| 394 | 1 |
| 395 | |
| 396 | :param value: value to count in sorted set |
| 397 | :return: count |
| 398 | |
| 399 | """ |
| 400 | return 1 if value in self._set else 0 |
| 401 | |
| 402 | |
| 403 | def discard(self, value): |