Given a positive number as a string, multiply the number by 11 and also return it as a string. However, there is a catch:
You are NOT ALLOWED to simply cast the number into an integer!
Now, how is this challenge even possible? Despite this, there is still a way to solve it, and it involves thinking about how someone might multiply by 11 in their head. See the tips below for guidance.
multiply_by_11("11") ➞ "121"
multiply_by_11("111111111") ➞ "1222222221"
multiply_by_11("9473745364784876253253263723") ➞ "104211199012633638785785900953"
There is a simple trick to multiplying any two-digit number by 11 in your head:
# 23 * 11
# Add together 2 and 3 to make 5
# Place 5 between the two digits to make 253
# 77 * 11
# Add together 7 and 7 to make 14
# Place 4 between the two digits to make 747
# Carry the 1 to make 847