Reverse Coding Challenge #2

Published by Helen Yu in

This is a reverse coding challenge. Normally you're given explicit directions with how to create a function. Here, you must generate your own function to satisfy the relationship between the inputs and outputs.

Your task is to create a function that, when fed the inputs below, produce the sample outputs shown.

Examples

3 ➞ 21

9 ➞ 2221

17 ➞ 22221

24 ➞ 22228

Notes

If you get stuck, check the Comments for help.

Watch a quick demo on how Edabit works.