+ 32

[ ASSIGNMENT: ] Balanced Number

Balanced Number is the number that : The sum of all digits to the left of the middle digit(s) and the sum of all digits to the right of the middle digit(s) are equal. TASK : Given a number, find if it is Balanced or Not ? NOTE! - If the number has an odd number of digits then there is only one middle digit, e.g. 92645 has middle digit 6; otherwise, there are two middle digits, e.g. 1301 has middle digits 3 and 0. - The middle digit(s) should not be considered when determining whether a number is balanced or not, e.g. 413023 is a balanced number because the left sum and right sum are both 5. - Number passed is always Positive! - Return the result as String! HappyCodings!:) https://code.sololearn.com/WxJ60m8Bxjta/?ref=app

27th May 2018, 3:27 PM
Danijel Ivanović
Danijel Ivanović - avatar
19 ответов
+ 20
Yes, you are right my friend, there is no example for a two-digit number! as you say, based on the logic we can conclude! 👍😉
28th May 2018, 6:23 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 18
~ swim ~ Don't worry my friend, I know you're going to do it! 😊👍
28th May 2018, 7:10 AM
Danijel Ivanović
Danijel Ivanović - avatar
27th May 2018, 7:20 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
VcC Thank you very much for your suggestion! 👌😊 I believe that the tasks I set for you are pretty easy, because you are an excellent programmer and I'm glad for you! 👏👏🤓 I have not reached such a high level in programming and because of that, it is difficult for me to set up tasks that I can not solve! 👍 Thank you very much for your interest and the support you provide me, 🤗 I will try to find more difficult tasks and set them up! 😄😆😉
27th May 2018, 4:24 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
VcC Thank you so much for such nice words! 😉 You are right and I absolutely understand you, I really appreciate your support and I will try to find a little more interesting and harder tasks, 👍😉 Best regards my friend! 🤗
27th May 2018, 4:56 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
~ swim ~ balancedNum(7) --> return "Balanced" balancedNum(45) --> return "Balanced" You have examples in the web code Balanced Number [TASK] 👍😉
28th May 2018, 5:40 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 15
https://code.sololearn.com/cY4RF9LsT5VC/?ref=app
28th May 2018, 11:27 AM
LukArToDo
LukArToDo - avatar
27th May 2018, 9:50 PM
reviiea
reviiea - avatar
+ 5
Danijel Ivanović You are too nice :-D. Maybe try to think about harder stuff involving some technic that would learn people (including me) stg
27th May 2018, 4:45 PM
VcC
VcC - avatar