We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Greedy
- Marc's Cakewalk
- Discussions
Marc's Cakewalk
Marc's Cakewalk
Sort by
recency
|
426 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch explanation here : https://youtu.be/RRJoL2vDmZM
My sol using JAVA :
long marcsCakewalk(int calorie_count, int* calorie) { unsigned long long int result=0; //selection sort for(int i=0;icalorie[minimum_index]){ minimum_index=j; } } if(minimum_index!=i){ swap(&calorie[i],&calorie[minimum_index]); } } for(int i=0;i