seen set
RU: множество «видел»
A hash set that stores values encountered while traversing data. For each new value, check if something that completes the answer is in the set (in O(1)). If not, add the value. Solves many O(n²) problems in O(n).
RU: множество «видел»
A hash set that stores values encountered while traversing data. For each new value, check if something that completes the answer is in the set (in O(1)). If not, add the value. Solves many O(n²) problems in O(n).