Lonely Integer

  • + 0 comments

    Python 3 Solution.

    Using list comprehensions.

    • Time complexity of O(n^2)
    • Space Complexity of O(1)
    def lonelyinteger(a):
        loner = [value for value in a if a.count(value) == 1]
        return loner[0]