Yoshi
(KidKoder)
June 4, 2020, 3:35pm
#1
Hello Koders ,
Bc nobody made today’s Daily Challenge, I thought to make it by myself.
Your task for today is to make a procedure which gets one input and has one output.
Rules:
input
(number) will be taken as index for:
output
(number) will be the digit (only one) number in this list:
12345678910111213141516...
and so on…
The real challenge is today, to make the list so long that it is as long as the input
.
Examples:
I hope you understood, this idea came to me from a math book for nerds
@Yoshi
EDIT: Forgot to say, for proof of functionality, use these inputs:
10, 25, 0 and 1,000,000.
2 Likes
I have already had my solution in my head, but I can’t use my computer now (have to wait like 9 hours) . I cant be as early as I can
1 Like
Yoshi
(KidKoder)
June 4, 2020, 4:04pm
#3
Well, don’t be
WatermelonIce:
I will post my solution tomorrow though.
1 Like
Vaibhav
(Vaibhav)
June 4, 2020, 4:21pm
#4
So the output would be a single number or list?
Like for example if input : 11 then will the output be 0
or 12345678910?
1 Like
Yoshi
(KidKoder)
June 4, 2020, 4:23pm
#5
Vaibhav:
the output be 0
Yes, you’re right. Self-answered!
Also you should see my examples…
1 Like
Vaibhav
(Vaibhav)
June 4, 2020, 4:25pm
#6
I asked because I got confused between this two of your statements
&
3 Likes
Hey check this out.
For this to get to work just provide any number using the text box and when button is clicked label1 text will be set to the number you are looking for.
This text will be blurred
Please add a spoiler or hide details immediately. Ok you add it.
Btw, my solutions
My solutions
Without using list (22 blocks)
(For me, it is the best solution among all my solutions)
With list (23 blocks)
With list (optimized, less lag than the upper one) (25 blocks)
Finally, this proof of functionality
Yoshi:
1,000,000.
Lags my entire phone.
2 Likes
I didn’t knew this post will be so informative
1 Like
Yoshi:
0
So what should return?
This should return nothing/error, because in the list,
there isn’t the 0th number.
vknow360
(Sunny Gupta)
June 5, 2020, 3:46am
#11
WatermelonIce:
So what should return?
Probably an empty string.
1 Like
vknow360:
an empty string.
If so, then I need to debug and add more blocks (and that’s isn’t a good thing)
vknow360
(Sunny Gupta)
June 5, 2020, 3:52am
#13
But we will have to wait for reply from @Yoshi
I have made a solution using 16 blocks
1 Like
vknow360:
wait for reply
Did 1 million (1,000,000) input lags your phone? I can’t even reach 20000
vknow360
(Sunny Gupta)
June 5, 2020, 5:38am
#15
Yes.I am also not able to get output.
About 6 hours to go, for the “official” answer…
vknow360
(Sunny Gupta)
June 5, 2020, 10:00am
#17
So before we get ‘official’ solution , I would like to post my solution here.
Note: It takes some time to get output for biggest numbers like 1,000,000 but it works normal for bigger numbers like 100,000
1 Like
Yours is much simplier than me. Good Job! (idk why I was think of for each number
before, but i used while test
.
Wow! My phone cannot reach that. It is already 8GB RAM
vknow360
(Sunny Gupta)
June 5, 2020, 10:25am
#19
Some studies say that for
loop is faster and consumes less memory then while
loop
Memu android emulator (Android 5.0) with 1 GB ram