Develop an algorithm in Python that takes an array of integers and finds two numbers whose sum is the given target.
The array : [1, 3, 5, 7, 9]
The target : 12
def two_sum(arr, target):
 for num1 in arr:
 for num2 in arr:
 if num1 + num2 == target:
 return (num1, num2)

result = two_sum([1, 3, 5, 7, 9], 12)
print(result)
# Output -> (5, 7)