Max Difference between two elements in Swift

Publicado el: 23 octubre 2018
en el 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...


En esta página del sitio puede ver el video en línea Max Difference between two elements in Swift de Duración hora minuto segunda en buena calidad , que subió el usuario Ilyas Uyanik 23 octubre 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 139 veces y le gustó 0 a los espectadores. Disfruta viendo!