Write a program that places a +, -, or a space between the digits 1, 2, ..., 9 (in this order) so that the result is 100. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Write a program that places a +, -, or a space between the digits 1, 2, ..., 9 (in this order) so that the result is 100.

Write a program that places a +, -, or a space between the digits 1, 2, ..., 9 (in this order) so that the result is 100. For example: 1 + 2 + 34 - 5 + 67 - 8 + 9 = 100. Task from: https://proglib.io/p/5-problems-for-software-engineer/

11th Sep 2017, 4:23 AM
Daniel Ustavshchikov
4 Answers
+ 2
hah, @VcC your challenge help me to solve this 😀 https://code.sololearn.com/W8Ot4n34o1xi/?ref=app
11th Sep 2017, 4:11 PM
ysraelcon
ysraelcon - avatar
+ 1
I think victory is mine. Sorry @ysraelcon https://code.sololearn.com/cean4Mq567qa/?ref=app
11th Sep 2017, 8:08 PM
VcC
VcC - avatar
0
It could be solved using recursion + memoization.. sorry but I can't code it now (laptop is not here 😁).. I'll code it as soon as possible
11th Sep 2017, 12:10 PM
Nour Alhadi Mahmoud
Nour Alhadi Mahmoud - avatar
0
Discard mul div and drop, add concat in the following code : https://code.sololearn.com/ccQZXwI4XcH7/?ref=app
11th Sep 2017, 12:37 PM
VcC
VcC - avatar