Daily Challenge #80

I did that just to simplify and as per requirements I was not prohibited from using extension.

Clever :joy:

Daily challenges shouldn’t be using any extensions tho, that’s the point of these,

But, I approve. Nice solution.

2 Likes

And the number of items was even not needed.

Wait what? Extension is not even allowed in daily challenge.

1 Like

Yeah, in my Python solution I just do int(input()) so it doesn’t store the data anywhere (takes less storage) and just call len(list_) when needed.

Edited my solution post. Check if you want.

1 Like

Nice!

Here’s me joining juuust short of the 24h mark.

Solution

This can be shortened with some local variables, but meh. :crazy_face:

2 Likes

Can you please screenshot what the result is for

100
4
33 30 2 1
1 Like

image

1 Like

It should be 0.

In this case, he buys the 33 3 times and 1 time the 1.

Hint: use while loop

I was unaware that the same item could be bought in multiples.

And that, kids, is why you don’t skim through questions.

Edit:

Solution
1 Like

Wait what? I have to edit now. :man_facepalming:
Edited. Please check again

1 Like

Read the challenge! :joy:

2 Likes

So mine was correct? Was it? 24 hours have passed so has the challenge ended?

I will put your solution at the end, since you did use extensions. So, if noone did it correctly, you get the mark.

1 Like

I did, right? :thinking:

1 Like

I think so, I can’t test it right now.

@Kanishka_Developer, @WatermelonIce, how many blocks have you got?