Updates from the Repl.it team about the product

← Back to all posts
Weekly Challenge #20
h
TheDrone7 (1654)

Hey there replers! 3 weeks ago, we started the 5th batch of repl.it weekly challenges!

So below are the results for the last weekly challenge aka Weekly Challenge #19.


WEEKLY 19 Results

Here are the results for the weekly challenge #19.

RANK 1 : @HarperframeInc

RANK 2 : @Lord_Poseidon

RANK 3 : @fuzzyastrocat

In case you did not make into the top 3, you can check out your score at the weekly results website - https://weekly.thedrone7.repl.co

But before that, here's this week's weekly challenge for you all!


DISTINCT MULTIPLICATION TABLES!

Moving on with this month's theme of more math, for this week's challenge, you are to take two integers as input from the user - r and c respectively and generate a table of r rows and c columns, index starting from 1 instead of 0. Then each cell value will be the product of the row and column indices. And then, use the table to check the number of unique values in the entirety of the table.

For example: -

User input : 3 4

Generated Table :

1 2 3 4
2 4 6 8
3 6 9 12

The distinct values are - 1, 2, 3, 4, 6, 8, 9, 12.

Output/Result : There are 8 distinct values in a 3x4 multiplication table.

SUBMISSION

For submitting your repls, post them on the repl talk share board and ensure that they contain #WEEKLY in their name.

NOTE : You cannot have multiple weekly challenge submissions but if you want to share multiple ways of achieving the goal, you can make regular posts that don't contain #WEEKLY in their name, even WEEKLY is fine.

And that's it for today, code away and have fun replers!

Comments
hotnewtop
FloCal35 (369)

Sept. monthly repl's?

HahaYes (1901)

Is this the next set for this month or not?

TheDrone7 (1654)

@HahaYes No, it isn't. That will be in 2 days from now.

HahaYes (1901)

@TheDrone7 ohhh thanks for the clarification Mr.H

[deleted]

Dude can u join the group repl I made I gave u an invite?
@HahaYes

HahaYes (1901)

@QuaziMayel bruh don't invite me to repl please because I didn't give permission.

[deleted]

Srry @HahaYes

Vandesm14 (2624)

@QuaziMayel Please don't invite people without their permission.

[deleted]

Dude I said sorry :C @Vandesm14

adl212 (159)

When is this due?

TheDrone7 (1654)

@adl212 back to normal, 5 more days to go.

FlaminHotValdez (372)

Can I just say, in C++ you can completely abuse set.

FlaminHotValdez (372)

Also, do we actually have to generate a table?

TheDrone7 (1654)

@maxyang it can also just be a 2D array but yes generating that is necessary.

fuzzyastrocat (1505)

@TheDrone7 Wait, is generating it as a 1D array ok? I'm completing the task by generating the table, but storing it as a 1D array (since LOLCODE doesn't have any array support aside from strings storing it as a 2D array is impossible).

TheDrone7 (1654)

@fuzzyastrocat yes you can generate just a 1D array too. What's required is for it to be generated, how to store it is up to you. Even displaying is optional.

firefish (937)

Could you put pipe charcaters | inbetween to make it look more.... elegant?

TheDrone7 (1654)

@firefish You can display it however you want to display it (you can even skip the displaying table part) but all I want to see is that you are generating a table and then calculating the number of unique values.

DungeonMaster00 (170)

is it okay to have error/exception handling if the user types in an invalid value

DungeonMaster00 (170)

@TheDrone7 and do we have to print the table

TheDrone7 (1654)

@DungeonMaster00 that's optional but it has to be generated, I'll be reading the source as well.

AmazingMech2418 (1017)

This one is too easy in JS, so I'm doing it in BrainF! So far have an array system! Next up: filtering distinct values and adding user input.

AmazingMech2418 (1017)

@AmazingMech2418 I liked the last one better, honestly... LOL! Please make them more challenging than this one in the future.

fuzzyastrocat (1505)

@AmazingMech2418 This one isn't super challenging, but I'm going to try to do it as efficiently as possible for performance. I could see where this could get pretty slow the larger you make the tables.

AmazingMech2418 (1017)

@fuzzyastrocat Well, for larger tables, it still wouldn't take too long. Though, you should be able to create a basic formula for it that could work. Such as maybe like, given that r < c, ceil(r^2/2)+(c-r)c?

fuzzyastrocat (1505)

@AmazingMech2418 Ooh, math is like my thing so I'm gonna try to figure one out

AmazingMech2418 (1017)

@fuzzyastrocat The only thing is though that there might be some stuff you have to do with prime factors.

fuzzyastrocat (1505)

@AmazingMech2418 Well, I looked it up on google and realized this is like a thing that hasn't been found by anyone... so I think the best way to do it is brute force calculation

fuzzyastrocat (1505)

@AmazingMech2418 I ended up doing mine in LOLCODE, which was interesting since LOLCODE has no lists except for strings

HahaYes (1901)

@AmazingMech2418 bruh are you trying to suffer by using brainf

fuzzyastrocat (1505)

Yay, more math!

(and yay, I got in the top 3 again)

davidyu9 (20)

Monthly Repls Sep?

TheDrone7 (1654)

@davidyu9 They'll be delayed by approx 1 week.

k9chelsea2 (768)

i havent even read this weeks challenge all I see is numbers which equals badd :(