+ 19
[CHALLENGE] custom min function
Make a function that finds min value from given list of numbers. Built-in functions like min(), Math.min()... are NOT allowed ! _______________________________ Input = [78,56,232,12,8,10,24] Output = [8]
17 Réponses
+ 21
https://code.sololearn.com/c5yfLe6pi7S5/?ref=app
+ 9
https://code.sololearn.com/cT9WGOdd70zQ/?ref=app
+ 6
https://code.sololearn.com/ccpB5xZ7UBqG/?ref=app
+ 5
just do this amine as a one liner
https://code.sololearn.com/cN0PAbkno0NI/?ref=app
also he said it had to be a function
+ 5
+ 4
you can sort the list then print the first element
https://code.sololearn.com/c3Bd3xP6T3li/?ref=app
+ 3
js solution:
https://code.sololearn.com/WLTL8svo0uUt/#js
+ 2
Hey all hope you're well. First challenge and post.
https://code.sololearn.com/cFZjdb314lqU/?ref=app
+ 1
yes obbu, using lambda is a good idea.
but some people do not understand lambda expression so I simplified the code
+ 1
0
int minreturn(int a[], int size) {int min =a[0];for(int i =0;i<size;i++)if(a[i]<min)min=a[i]; cout<<min;}
0
return min;