Design an algorithm in Python to find the second smallest number in an array.
[45, 25, 12, 34, 36]
def second_smallest_num(arr):
    min1 = min(arr)
    arr.remove(min1)
    min2 = min(arr)
    return min2


arr = [45, 25, 12, 34, 36]
res = second_smallest_num(arr)
print(res)