Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve (number) {
- let arr = number.toString().split('');
- while (arr.map(Number).reduce((a,b) => a + b, 0) / arr.length <= 5) {
- arr.push('9');
- }
- console.log(arr.join(''));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement