Challenge::Divide The six numbers to 2 equal groups . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Challenge::Divide The six numbers to 2 equal groups .

Given a 6 numbers Check if you can divide them to 2 groups such that each group contains exactly 3 numbers and the sum of the 2 groups are equal ? if the you could do so : Print "YES" . print "NO" otherwise. sample input : 1 2 3 2 2 2 sample output: YES // you can divide them as : (1+2+3) & ( 2+2+2)

13th Nov 2017, 4:04 AM
Mohamed Hamada
Mohamed Hamada - avatar
3 Answers
14th Nov 2017, 6:41 AM
#RahulVerma
#RahulVerma - avatar
+ 1
Should we ask for inputs or have random samples we make our own? this one asks for inputs, as usual, enter 6 numbers separated by new line in SoloLearn input dialog. https://code.sololearn.com/cRY6jPTPvbl8/?ref=app
20th Nov 2017, 7:38 AM
Ipang
0
@#RahulVerma Sorry but your code doesn't work. i don't no what the problem ! ( i'm a C++ guy :D )
19th Nov 2017, 10:16 PM
Mohamed Hamada
Mohamed Hamada - avatar