Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 562 Bytes

counter_technique.md

File metadata and controls

22 lines (13 loc) · 562 Bytes

Counter technique

The counter technique is a technique used to count the number of occurrences of a certain value in a list. It is a very useful technique that can be used to solve many problems.

Example of implementation

from collections import Counter

def counter_technique(nums):
    counter = Counter(nums)
    for key, value in counter.items():
        if value == 1:
            return key

Problem

Find All Numbers Disappeared in an Array