def careful_shuffle(lst):
    """Returns a new list based on a given iterable, with the elements shuffled
    such that the number of duplicate consecutive elements are minimized."""
c = Counter(lst)
if len(c) < 2:
    return lst
Algorithm to shuffle a list to minimise equal neighbours