+ 7
Need help in a algorithm.
I can't create a algorithm for this problem : Take input of number consisting of four digits. generate the maximum and minimum numbers using the four digits entered. Try it for 2005.
10 Antworten
+ 5
~ swim ~ thanks man👍
+ 4
~ swim ~ can you help me modify this code.
https://code.sololearn.com/c2n9dAgXADDo/?ref=app
+ 4
in c++ you can make a vector of these 4 digits .
and then sort it for example/
vector<int> digits;
//for minimum
sort(digits.begin(), digits.end());
//for maximum
sort(digits.end(), digits.begin());
+ 3
Use array with 4 numbers. Sort the array. Get numbers for index 0 and 3. Use List in Python. 🤔
+ 2
Hope this helps.. .!!
https://code.sololearn.com/cvWpXjXRyEG5/?ref=app