def bubble_sort(l, r):
    """
    Sorts a list using Bubble Sort Algorithm
    """
    l = l.copy()
    for i in range(0, r, 1):
        for j in range(0, r - i - 1, 1):
            if l[j] > l[j + 1]:
                l[j], l[j + 1] = l[j + 1], l[j]
    return l