Peter
(Moderator)
#1
Express Number in Expanded Notation
Create a function that takes a number and return a string with the number in expanded notation (AKA expanded form).
Examples
expand(13) ➞ "10 + 3"
expand(86) ➞ "80 + 6"
expand(17000000) ➞ "10000000 + 7000000"
expand(5325) ➞ "5000 + 300 + 20 + 5"
Notes
You can expect only whole numbers greater than 0 as test input.
6 Likes
Hint to those scratching their heads: try using the length()
block.
5 Likes
ravigarg
(Ravi Garg)
#3
Max I was able to achieve after an hour.
1 Like
vknow360
(Sunny Gupta)
#4
Use it in a result/value returning procedure.
1 Like
ravigarg
(Ravi Garg)
#5
Has anyone found the solution??
we are curious, show your blocks …
Boban
(Boban Stojmenovic)
#9
Actually I failed on this one, so I have to recheck the code again
Edit
2 Likes
maybe something like that:
challenge_37.aia (10.4 KB)
a little awkward … admitted, but it works
lists are not my thing
4 Likes
Boban
(Boban Stojmenovic)
#11
As long as it is fully functional, it is ok
Here is mine
5 Likes
For the sake of completeness:
2 Likes