Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA
SOLVED

Challenge #135: Locker Problem

FrederikE
13 - Pulsar
Spoiler
FrederikE_1-1649434840913.png

 


FrederikE_0-1649434829491.png

 

TonyAndriani
9 - Comet

Reposting under my new user ID.

binuacs
20 - Arcturus

solution attached

scoles0617
8 - Asteroid

My solution:

mmontgomery
10 - Fireball

Challenge #135

DataNath
17 - Castor

My solution to #135.

 

Spoiler
Flow:

DataNath_1-1656075649110.png



Macro:

DataNath_2-1656075668780.png

 

JamesCharnley
13 - Pulsar
Spoiler
JamesCharnley_0-1656406525305.pngJamesCharnley_1-1656406545953.png

 

 

Don't often feel like I'm struggling with the logic on these but the configuration can take a while. Just need to keep practising!

DSinnett
Alteryx Alumni (Retired)

I haven’t explored all the submissions for this challenge, but I’ll assume that others have had the same thoughts.  A student only changes a locker door if their student number is a factor of the locker number, i.e. IF MOD([LockerNum], [Iteration])=0.  That means that a locker door is changed based on the number of factors it has.  Factors come in pairs, so a quick (erroneous) conclusion would be that the door’s status is changed an even number of times, leaving them all closed.  However, even the very first locker, whose pair of factors is 1x1, only gets switched once since student #1 only gets one turn.  Similarly, locker 4 (1x4, 2x2) gets switched 3 times (1,2,4). Inductively, only those lockers whose numbers are perfect squares are left open since these are the only lockers with an odd number of distinct factors.  Using this principle allows for a more scalable solution in case you would like to play this game at a major university or set up lockers for everyone in the country.  I set the limit on the Numeric input at 500M but modify all you want.  Have fun.

thano_thayalan
5 - Atom

Solution for 135 with Iterative macro

dorinnaP
8 - Asteroid

My solution: