Max Difference between two elements in Swift

Pubblicato il: 23 ottobre 2018
sul canale di: 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...


In questa pagina del sito puoi guardare il video online Max Difference between two elements in Swift della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Ilyas Uyanik 23 ottobre 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 139 volte e gli è piaciuto 0 spettatori. Buona visione!