fork download
  1. def findMin(arr, left, right):
  2.  
  3. if left == right:
  4. return arr[left]
  5. else:
  6. m = (left + right) >> 1
  7. a = findMin(arr, left, m);
  8. b = findMin(arr, m + 1, right)
  9. if a < b:
  10. return a
  11. else:
  12. return b
  13.  
  14. def main():
  15.  
  16. arr = [1,23,-13,421,5,10];
  17. min = findMin(arr, 0, len(arr) -1)
  18. print(min)
  19.  
  20. main()
Success #stdin #stdout 0.03s 9204KB
stdin
Standard input is empty
stdout
-13