[CHALLENGE] custom min function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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]

16th Feb 2018, 12:09 PM
r8w9
r8w9 - avatar
18 Answers
18th Feb 2018, 3:27 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 21
https://code.sololearn.com/c5yfLe6pi7S5/?ref=app
16th Feb 2018, 1:07 PM
LukArToDo
LukArToDo - avatar
16th Feb 2018, 1:52 PM
VISHAL SRIVASTAVA
VISHAL SRIVASTAVA - avatar
+ 9
https://code.sololearn.com/cT9WGOdd70zQ/?ref=app
16th Feb 2018, 2:34 PM
D_Stark
D_Stark - avatar
17th Feb 2018, 12:45 AM
Med Arezki
Med Arezki - avatar
+ 6
https://code.sololearn.com/ccpB5xZ7UBqG/?ref=app
16th Feb 2018, 9:21 PM
Pedro Demingos
Pedro Demingos - avatar
16th Feb 2018, 12:45 PM
Nitzan
Nitzan - avatar
+ 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
16th Feb 2018, 12:46 PM
Obbu
Obbu - avatar
16th Feb 2018, 3:52 PM
VcC
VcC - avatar
+ 4
you can sort the list then print the first element https://code.sololearn.com/c3Bd3xP6T3li/?ref=app
16th Feb 2018, 12:22 PM
Amine Trabelsi
Amine Trabelsi - avatar
16th Feb 2018, 4:18 PM
Pawko
Pawko - avatar
+ 2
Hey all hope you're well. First challenge and post. https://code.sololearn.com/cFZjdb314lqU/?ref=app
18th Feb 2018, 3:14 PM
MrSirT
MrSirT - avatar
+ 1
yes obbu, using lambda is a good idea. but some people do not understand lambda expression so I simplified the code
16th Feb 2018, 12:47 PM
Amine Trabelsi
Amine Trabelsi - avatar
18th Feb 2018, 6:37 PM
Matheus Fernandes
Matheus Fernandes - avatar
+ 1
https://code.sololearn.com/cxYy54X1ehJF
14th Jul 2018, 12:06 PM
ISkylake
ISkylake - avatar
20th Dec 2018, 7:24 PM
Flash
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;}
18th Feb 2018, 12:58 AM
Sunita Singh
Sunita Singh - avatar
0
return min;
18th Feb 2018, 12:58 AM
Sunita Singh
Sunita Singh - avatar