Finish the solution so that it sorts the passed in array of numbers. If the function passes in an empty array or null/nil value then it should return an empty array.

For example:

```python
solution([1,2,3,10,5]) # should return [1,2,3,5,10]
solution(None) # should return []
```

```Hakell
sortNumbers [1, 2, 10, 50, 5] = Just [1, 2, 5, 10, 50]
sortNumbers [] = Nothing
```

Difficulty: introductory

Starter code:

def solution(nums):
	

Solutions:
def solution(nums):
    return sorted(nums) if nums else []

solution = lambda l: sorted(l) if l else []


def solution(nums):
    return sorted(nums or [])

def solution(nums):
    return [] if nums is None else sorted(nums)

def solution(nums):
    return sorted(nums) if isinstance(nums, list) else []

def solution(nums):
    if not nums:
        return []
    return sorted(nums)

def solution(nums):
    if nums == None:
        return []
    if len(nums) < 2:
        return nums
    pivo = nums[0]
    less = [i for i in nums[1:] if i < pivo]
    great = [i for i in nums[1:] if i > pivo]
    return solution(less) + [pivo] + solution(great) 

def solution(nums):
    if nums != [] and nums != None:
        nums.sort()
        return nums
    else:
        return []

def solution(nums):
    pass
    if nums != [] and nums != None:
        nums.sort()
        return nums
    else:
        if not nums:
            return []


def solution(name):
    return sorted(name) if name  else []

solution = lambda a: list(sorted(a)) if a else []

def solution(nums):
    return nums and sorted(nums) or []

def solution(nums):
    if(nums) == None: return []
    nums.sort()
    return nums

def solution(nums):
    return [] if not nums else sorted(nums)

solution = lambda x : x and sorted(x) or []

def solution(nums):
    array = []
    try:
        while len(nums) > 0:
            array.append(min(nums))
            nums.remove(min(nums)) 
    except:
        pass
    return array

def solution(n,q=[]):
    if n == None:
        return q
    o = []
    for i in n:
        o += chr(i)
        o.sort()
    p = []
    for i in o:
        p.append(ord(i))
    return p

def solution(nums):
    if nums == None:
        return []
    if len(nums)==0:
        return []
    low = nums[0]
    other = nums[1:].copy()
    mlist = solution(other)
    niggers = []
    for i in mlist:
        if i < low:
            niggers.append(i)
    p = 0
    if len(niggers) != 0:
        p = min(niggers)
    mlist.insert(p,low)            
    return mlist


def solution(nums):
    if type(nums) != list: return []
    nums.sort()
    return nums

def solution(nums):
    if nums == None or nums == []:
        return []
    else: 
        return sorted(nums)

def solution(nums):
    print(nums)
    horizontal=[]
    vertical=[]
    if not nums or nums is None:
        return []
    else:
        return sorted(nums)

def solution(nums):
    if nums != None:
        return list(set(nums))
    else:
        return []

def solution(nums):
    if nums!=None:
        nums.sort()
        return nums
    else:
        return list()
    


def solution(nums):
    if nums is None:
        return []
    sorted_nums = sorted(nums)
    if len(sorted_nums) > 0:
        return sorted_nums
    else:
        return []

def solution(nums: list) -> list:
    """ This function sorts the passed in array of numbers. """
    if nums is None:
        return []
    return sorted(nums)

def solution(nums):
    l = []
    if nums == None:
        return l
    else:
        return sorted(nums)
    


def solution(array):
    return sorted(array) if array is not None else []


def solution(nums):
    if nums == None:
        return []
    elif len(nums) < 1:
        return []
    else:
        return sorted(nums)

def solution(nums):
    if None != nums:
        nums.sort()
        return nums
    return []

def solution(nums):
    return [*sorted(nums)] if nums else []

def solution(nums):
    if nums is None:
        return []
    X = sorted(nums)
    return X

def solution(nums):
    '''We will handle the anticipated num argument with an if/else statement'''
    return sorted(nums) if nums!=None else []

def solution(nums):
    car=[]
    if nums==None:
        return car
    else:
        return sorted(nums)

def solution(nums=[]):
    try:
        if len(nums) > 0:
            nums.sort()
            return nums
        elif len(nums) == 0:
            return []
    except:
        return []


def solution(nums=[]):
         return [] if nums is None else sorted(nums)

def solution(nums):
    if type(nums) !=list: 
        return []   
    
    if len(nums)==0:
        return []
    return sorted(nums)

def solution(nums=0):
    if nums == []:
        return []
    elif nums == None:
        return []
    else:
        return sorted(nums)

def solution(nums):
    new_list = []
    while nums:
        min = nums[0]  
        for x in nums: 
            if x < min:
                min = x
        new_list.append(min)
        nums.remove(min)    
    return new_list

def solution(array):
    return [] if array is None else sorted(array)

def solution(nums):
    if type(nums) == type(None):
        return []
    else:
        return sorted(nums)

def solution(nums):
    return ([[] if nums == None else sorted(nums)][0])
#     if nums == [] or nums == None:
#         return []
#     else:
#         return sorted(nums)
    


def solution(nums):
    emptyarr = []
    if nums == None:
        return []
    else:
        return sorted(nums)


def solution(nums):
    badList = nums
    if badList ==  None:
        a=[]
        return a
    if len(badList)<2:
        return badList
    else:
        length = len(badList) - 1
        unsorted = True
        while unsorted:
            for element in range(0,length):
                unsorted = False
                if badList[element] > badList[element + 1]:
                    hold = badList[element + 1]
                    badList[element + 1] = badList[element]
                    badList[element] = hold
                else:
                    unsorted = True 
        return badList

def solution(nums):
    if nums == None:
        return []
    else:
        nums_sorted = sorted(nums)
    return nums_sorted


def solution(nums):
    # Bust a move right here
    if nums==None: return []
    else: return sorted(nums)


def solution(nums):
    if nums == None: return []
    else:
        x = []
        for i in range(len(nums)):
            x.append(min(nums))
            nums.remove(min(nums))
        return x

def solution(a = []):
    try:
        for i in range(len(a)-1):
            for j in range(len(a)-i-1):
                if a[j] > a[j+1]:
                    a[j], a[j+1] = a[j+1], a[j]
        return a
    except TypeError:
        a = []
        return a

def solution(nums):
    list1 = []
    check = type(nums)
    if check == list:
        return sorted(nums)
    else:
        return list1
        


def solution(nums):
    return sorted([*nums]) if nums else []

def solution(nums, default=None):
    if nums:
        nums.sort()
        return nums
    else:
        nums = []
        return  nums

def solution(nums):
    if nums == None:
        empty_arr = []
        return empty_arr
    nums.sort()
    return nums

def solution(nums):
    numbers = nums
    print(numbers)
    
    if numbers == None:
        return []
    
    re_arranged =  sorted(numbers)
    
    print(re_arranged)
    
    return re_arranged 

def solution(nums: list) -> list:
    if nums != None:
        length = len(nums)
        if length > 0:
            return sorted(nums)
        else:
            return []
    else:
        return []

def solution(nums):
    if not nums:
        return []
    else:
        for x in range(len(nums)):
            for i in range(len(nums) -1):
                if nums[i]>nums[i+1]:
                    temp = nums[i]
                    nums[i] = nums[i+1]
                    nums[i+1] = temp
        return nums

def solution(nums):
    l = []
    if nums == [] or nums == None:
        return []
    while nums:
        l.append(min(nums))
        nums.remove(min(nums))
    return l
        
        


def solution(nums):
    if type(nums) == list:return sorted(nums)
    elif type(nums) != list:return []

def solution(nums):
    lst=[]
    if nums == None:
        return lst
    nums = sorted(nums)
    return nums

def solution(nums):
    if nums is None:
        return []
    else:
        return sorted(set(nums))


def solution(nums = None):
    return [] if nums is None else sorted(nums)

def solution(nums):
    a = []
    if nums == None:
        return []
    else:
        for x in nums:
            a.append(x)
    a.sort()
    return a

def solution(nums):
    print(nums)
    if nums==None:
        return []

    try:
        return sorted(nums)
    except:
        return None

def solution(nums):
    # nums.sort()
    # return nums
    if nums == None:
        return []
    elif len(nums) == 0:
        return []
    for i in range(0, len(nums)):
        print((nums[i]))
        for j in range(0, len(nums)-1):
            print((nums[j]))
            if nums[j] > nums[j+1]:
                temp = nums[j]
                nums[j] = nums[j+1]
                nums[j+1] = temp

    return nums



def solution(nums):
    if nums:
        nums = [int(x) for x in nums]
        nums.sort()
        return nums
    else:
        return []

def solution(nums):
    if type(nums) != list:
        return []
    else:
        return sorted(nums)

def solution(nums):
    if nums != None:
        res = sorted(nums)
        return res
    else:
        return []

def solution(nums=None):
    print(nums)
    if nums == None:
        return []
    else:
        return sorted(nums)

def solution(nums=None):
    print(nums)
    if nums:
        return sorted(nums)
    elif nums == None:
        return []
    elif nums == []:
        return []


def solution(nums):
    if nums is None:
        return []
    else:
        y = sorted(nums)
    return y

def solution(nums):
    print(nums)
    
    if(nums == []):
        return []
    if(nums == [1, 2, 3, 10, 5]):
        return [1, 2, 3, 5, 10]
    if(nums == [1, 2, 10, 5]):
        return [1, 2, 5, 10]
    if(nums == [20, 2, 10]):
        return [2, 10, 20]
    if(nums == [2, 20, 10] ):
        return [2, 10, 20]
    if(nums == None):
        return []
        


def solution(nums=None):
    return [] if nums==None else sorted(nums)

def solution(nums):
    if type(nums)==list:
        return sorted(nums)
    else:
        empty = []
        return empty


def solution(nums=None):
    if nums==None:
        return []
    return sorted(nums)

def solution(nums= []):
    if nums == None or len(nums) == 0:
        return [];
    for i in range (len(nums)-1,0,-1):
        # print(i)
        for j in range(i):
            if nums[j] > nums[j+1]:
                helper = nums[j]
                nums[j] = nums[j+1]
                nums[j+1] = helper
    return nums
# print(solution(nums))




def solution(nums):
    if not nums or len(nums) == 0:
        return [] 
    sorted = nums.copy()
    sorted.sort()
    return sorted

def solution(nums):
    pass
    if nums is None:
        nums = []
    nums.sort()
    return nums

def solution(nums):
    if nums == None:
        return []
    pulls = len(nums)
    if len(nums) == 0:
        return []
    li = []
    for i in range(pulls):
        p = 0
        for n in range(len(nums)):
            if nums[n] < nums[p]:
                p=n
        li.append(nums[p])
        nums = nums[:p] + nums[p+1:]
    return li

def solution(nums):
    if nums == None:
        return []
    num1 = sorted(nums)
    return num1

def solution(nums):
    if nums == [] or nums == None or nums == 0: return []
    return sorted(nums)

def solution(nums):
    if nums!=None:
        nums.sort()
    if (nums!=[] and nums!=None):
        return nums
    else:
        return []

def solution(nums):
    x = []
    if not nums:
        return x
    else:
        nums.sort()
        return nums


def solution(nums=0):
    return [] if nums == None else sorted(nums)

def solution(nums):
    if str(nums) == 'None':
        return []
    else:
        return sorted(nums)

def solution(nums):
    return sorted(nums) if None is not nums else []

def solution(nums=None):
    try:
        if nums == None:
            return []
        else:
            return sorted(nums)
    except:
        pass

solution([1,2,10,5])

import pandas as pd
def solution(nums):
    df = pd.DataFrame()
    df['S']=nums
    answer = list(df['S'].sort_values().values)
    print (list(answer))
    return answer

def solution(nums):
    if nums is not None:
        nums.sort()
        return(nums)
    if nums is None:
        return([])


def solution(nums):
    if(nums):
        return sorted(list(nums))
    return []

def solution(nums):
    if nums:
        x = sorted(nums)
        return(x)
    else:
        return []

def solution(nums):

    List = []

    if nums != None:
        for num in range(len(nums)):
            minNum = min(nums)
            List.append(minNum)
            nums.remove(minNum)

    return List

def solution(nums):
    list = nums
    if nums:
        insertion_sort(list)
    else:
        return []
        
    return list


def insertion_sort(A):
    for i in range(1, len(A)):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = key
        


#More elegant:
def solution(nums):
    return (sorted(nums) if nums is not None else [])


#More detailed:
def solution(nums):
    if nums is None:
        return []
    else:
        #nums.sort()
        return sorted(nums)

def solution(nums):
    if nums is None:
        return []
    else:
        #nums.sort()
        return sorted(nums)

def solution(nums):
    r=[]
    while nums:
        mini=min(nums)
        nums.remove(mini)
        r.append(mini)
    return r


def solution(nums):
    num2 = []
        
    if nums == None:
        return num2
    else:
        return sorted(nums)



def solution(nums):
    nums3 = []
    if nums == None:
        return nums3
    else:
        return sorted(nums)

def solution(nums):
    arr = []
    while nums:
        minimum = nums[0]
        for i in nums:
            if i < minimum:
                minimum = i
        arr.append(minimum)
        nums.remove(minimum)
    return arr

def solution(nums):
    if (nums is not None):
        nums = sorted(nums)
        return nums
    else:
        return []

def solution(nums):
    if nums== None: 
           return []
    else:
       nums=list(set(nums))
        
       nums.sort()
    
       
       return nums

def solution(nums):
    if nums == None: return []
    return [x for x in sorted(nums)]

def solution(nums):
    if nums == [] or nums == None:
        nums = []
    else:
        nums.sort()
    return nums