• + 0 comments

    Python, using reduce

    import reduce from functools
    
    def gemstones(arr):
        sarr = list(map(set, arr))
        return len(reduce(lambda c, f: c.intersection(f), sarr))