Daily Challenge #78

Hello Koders :kodular:,

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:

  • input: 12 :arrow_right: output 1 bc:
    123456789101112… eleventh digit

  • input 25 :arrow_right: output 7 bc:
    12345678910111213141516171819… 25th digit

I hope you understood, this idea came to me from a math book for nerds :nerd_face:

@Yoshi

EDIT: Forgot to say, for proof of functionality, use these inputs:

10, 25, 0 and 1,000,000.

2 Likes

:sob: 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

Well, don’t be

I will post my solution tomorrow though.
:hugs: :kissing_heart:

1 Like

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

Yes, you’re right. Self-answered! :smiley_cat:

Also you should see my examples… :sweat_smile:

1 Like

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
image

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)
DC #78 without YailList

With list (23 blocks)

With list (optimized, less lag than the upper one) (25 blocks)

Finally, this proof of functionality

Lags my entire phone.

2 Likes

I didn’t knew this post will be so informative :+1:t2:

1 Like

So what should return?
This should return nothing/error, because in the list,

there isn’t the 0th number.

Probably an empty string.

1 Like

If so, then I need to debug and add more blocks (and that’s isn’t a good thing)

But we will have to wait for reply from @Yoshi

I have made a solution using 16 blocks

1 Like

Did 1 million (1,000,000) input lags your phone? I can’t even reach 20000

Yes.I am also not able to get output.

About 6 hours to go, for the “official” answer…

So before we get ‘official’ solution , I would like to post my solution here.

blocks (46)

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

Some studies say that for loop is faster and consumes less memory then while loop

:joy:
Memu android emulator (Android 5.0) with 1 GB ram :sweat_smile:

:scream: :scream: :scream:
Maybe build an apk is better than companion?
I tried your solution, and I still can’t reach 100000