Remove and extract duplicate elements from a list (array) in Python https://from-locals.com/python-list-unique-duplicate/