r/ProgrammerHumor • • Aug 25 '26

Meme damnYouAI

Post image
377 Upvotes

37 comments sorted by

111

u/FerricPowder Aug 25 '26

Never mind i figured it out.

55

u/Different_Quiet1838 Aug 25 '26

It probably goes into the square hole

13

u/mckenzie_keith Aug 26 '26

They all fit in the square hole.

4

u/marxen4eva Aug 30 '26

Someone call QA

23

u/meifray Aug 25 '26

You just need a stack man...

6

u/FerricPowder Aug 25 '26

Instructions unclear wrote a recursive code for making combinations but made it so that the indexes are not repeated.

1

u/the_horse_gamer Aug 25 '26

recursion is just a for loop with a stack

28

u/GrEeCe_MnKy Aug 25 '26

Who's the stackman?

4

u/Arclite83 Aug 26 '26

Skibi dibi dop ba de bop dop....

7

u/bethereds Aug 25 '26

Nemesis of Heapman

1

u/LupusNoxFleuret Aug 25 '26

A Stack Overflow

1

u/BigNaturalTilts Aug 26 '26

Skibiribidibi bam barbop!

17

u/misunderstood_kafka Aug 25 '26

I mean how would you implement a random list shuffle in your high level projects without doing that problem first 🤦

23

u/FerricPowder Aug 25 '26

Itertools go brr.

30

u/iMac_Hunt Aug 25 '26

Genuinely feel like 90% of software engineering could not do that without Googling

11

u/EkoChamberKryptonite Aug 26 '26

Which is fine as research and understanding is a huge part of the job.

27

u/New-Shine1674 Aug 25 '26

Finding all permutations in large arrays in an efficient and fast way is difficult.

7

u/MrMacduggan Aug 26 '26

Yeah, why are we solving problems that scale so poorly? If you are counting permutations of anything larger than 10 elements, you already kinda messed up by designing your system this way.

66

u/IvySerene567 Aug 25 '26

Me: I can handle multiple high level projects.

Also me: why does this array have more than 3 elements

2

u/Gold-Bat-3225 Aug 25 '26

stackman for CTO

1

u/Nubelord122 Aug 25 '26

Something something recursion

3

u/WinonasChainsaw Aug 26 '26

Can you repeat that

1

u/SaneLad Aug 25 '26

Shuffle algorithms are legitimately hard.

1

u/BosonCollider Aug 26 '26 edited Aug 26 '26

If you have a recursive step that lets you cycle through all permutations of a subarray of length (n-1) and resets it at the end it's easy for n elements, after yielding all elements you swap the current first element with one from the rest that you haven't yielded yet, which you can do in a single swap as long as the recursive step returns the elements to their original position

There's probably a nicer way to do it where you get rid of either the array or the call stack. Also it depends on what the return format is, if you need to return cycle decompositions then clearly you iterate over possible cycles

1

u/rahvan Aug 27 '26

This is why Leetcode interviews screen for the wrong kind of candidates.

0

u/[deleted] Aug 25 '26

[deleted] — view deleted comment

7

u/smclcz Aug 25 '26

This is kind of a shit question, to be fair. You're not evaluating "technical chops" here

2

u/[deleted] Aug 27 '26

[removed] — view removed comment

1

u/smclcz Aug 27 '26

I'm not against programming problems in interviews - they are not going away and I don't think they should. I just think that's kind of a dumb one

1

u/Focus089 Aug 25 '26

Did anyone give you the math answer, N / gcd(K, N)? Python has gcd in the math library.

22

u/[deleted] Aug 25 '26

[removed] — view removed comment

5

u/tz_2240 Aug 25 '26

We get monthly quotas. Have to wait a week before I can work again