+ 9

[ CHALLENGE ] Buy a better calculator... or try to make the best use of this one

Imagine you own a calculator that can only perform two operations: 1. Add one (+1), and 2. Multiply by two ( *2) The task is to determine how many ways (different sequences of these two operations) are there to get a number starting from another number. For example: > start = 3, finish = 6. There are two ways to make it, listing the numbers of operations they are [1,1,1] and [2] > start = 3 finish = 8 Three ways: [1,1,1,1,1], [1,2], [2,1,1] (basic) just count the number of all possible ways (extra) list all these ways my (basic) try using recursion is here: https://code.sololearn.com/cRWKHX9BChjF/#java

3rd Mar 2018, 11:49 AM
MARTA
MARTA - avatar
3 Answers
+ 7
@MARTA There was an update to the IOS app which added lessons in it. unfortunately, if you can't find Lesson Factory in main menu similar to Quiz Factory then it may not be available for now. They may add it in a future app update.
3rd Mar 2018, 12:24 PM
Lord Krishna
Lord Krishna - avatar
+ 5
You can submit this as an assignment in lesson factory; It can even unlock you some badges and get your challenge better visibility. https://www.sololearn.com/discuss/1082512/?ref=app
3rd Mar 2018, 11:57 AM
Lord Krishna
Lord Krishna - avatar
+ 3
@ Lord Krishna: that would be great. I couldnā€™t actually find how I could submit it any way except q&a. I can reach SL via web / my IPhone, I thought quiz factory is only reachable from android, isnā€™t it?
3rd Mar 2018, 12:09 PM
MARTA
MARTA - avatar