Hello again fellow replers! Last week, we started our weekly challenges, check out that post by clicking here.
Today, I'm posting this week's challenge. But before that, a few more instructions that weren't mentioned in the last post.
- You are allowed to make only 1 submission. Only submit after you're completely sure about submitting your submission. Your score won't be updated once your submission is scored.
- If there is any sort of condition in which your submission does not satisfy the challenge's requirement, it's score will be
And that's it! Now, let's get back to this week's weekly challenge.
Number of digits (but palindromic)!
Write a program that takes a numerical input (integer) from the user (for example:
n). For all the numbers between 0 and
n, count the number of digits in each of these numbers and get the total number of digits among all these numbers. Then find the number closest to the total number of digits such that the found number is a palindrome (for example:
x) and print out
Total = 0
For 0 to 9, number of digits = 1. Total = 1 * 10 = 10.
For 10 to 20, number of digits = 2. Total = 1 * 10 + 2 * 11 = 32.
Closest number to 32 that is also a palindrome =
Again, for submitting your repls, post them on the share board and be sure to keep
#WEEKLY in the post's title.
If you have any further questions, you can ask them via the comments section, and if you don't, I would still recommend going through the comments section as they may contains some extra information.
Given below are the results for last week's weekly challenge.
WEEKLY CHALLENGE 1 - RESULTS
@sugarfi : https://repl.it/talk/share/WEEKLY-Underscore-Edition/36190
@Scoder12 : https://repl.it/talk/share/WEEKLY-Challenges-1-Fractions-solution/36204
@EthanHorowitz : https://repl.it/talk/share/WEEKLY-1-Binary-By-Hand/36274
@Lord_Poseidon : https://repl.it/talk/share/WEEKLY-binary-arithmetic-because-why-not/36273
- During this challenge, we did allow submitting multiple times or updating your submissions but it won't be allowed from this week.
- We did not score the submissions which had errors.
Two of the most common errors were - Division by 0 (For people doing inverse division) and Infinite recursion (When entering a negative number for those who used recursion).
And that's it! Good luck with this week's weekly challenge and have fun!
@TheDrone7 Hey, I have a quick question. So at the start of today, I was at like 580 cycles, however, as soon as you posted this, I jumped to 700. And it's not only me seeing this, @johnstev111 also reports the same thing. So I was just wondering, is this glitch, or did you award me 120 cycles for coming in second place?
@CodeLongAndPros basically, count the amount of chars there are from 0 to INPUT, then find the closest palindrome to that number
So basically, if the user entered 20, (there are 32 digits from 0 to 20: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), and the closest palindrome to that number would be 33