fork(1) download
  1. def min_max_recur_1(vetor, tam):
  2. if tam == 1:
  3. return (vetor[0], vetor[0])
  4. else:
  5. resp_menor = min_max_recur_1(vetor, tam - 1)
  6. return (min(resp_menor[0], vetor[tam - 1]), max(resp_menor[1], vetor[tam - 1]))
  7.  
  8. print(min_max_recur_1([1,2,3,4], 4))
Success #stdin #stdout 0.02s 9104KB
stdin
Standard input is empty
stdout
(1, 4)