Source code for kyu_6.find_the_odd_int.find_the_odd_int

"""
Solution for -> Find the odd int.

Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""

from typing import List, Dict


[docs] def find_it(seq: List[int]) -> int: """ Find the int that appears an odd number of times. :param seq: list :return: int """ pares: Dict[int, int] = {} result: int = 0 for n in seq: if n not in pares: pares[n] = 1 else: pares[n] = pares[n] + 1 for key, item in pares.items(): if item % 2 > 0: result = key break return result