Max Difference between two elements in Swift

Publicado em: 23 Outubro 2018
no canal de: Ilyas Uyanik
139
0

Given an array arr[] of integers, find out the maximum difference between any two elements such that larger element appears after the smaller number.
Examples :

Input : arr = {2, 3, 10, 6, 4, 8, 1}
Output : 8
Explanation : The maximum difference is between 10 and 2.

Input : arr = {7, 9, 5, 6, 3, 2}
Output : 2
Explanation : The maximum difference is between 9 and 7.

Reference : https://www.geeksforgeeks.org/maximum...


Nesta página do site você pode assistir ao vídeo on-line Max Difference between two elements in Swift duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ilyas Uyanik 23 Outubro 2018, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 139 vezes e gostou 0 espectadores. Boa visualização!