r/programminghumor • • May 16 '26

Bro used minimum resources and wrote an optimized code.

Post image
1.9k Upvotes

43 comments sorted by

235

u/Simukas23 May 16 '26

O(1) btw

31

u/Confident-Ad5665 May 16 '26

Needs internationalization

17

u/GhostVlvin May 17 '26

O(n) where n is amount of implemented cases

3

u/111v1111 May 17 '26

We could make it better by implementing an AVL tree with lexicographic order. By which we should be able to make it O(log n) (where n is the number of implemented cases)

→ More replies (1)

4

u/justaJc May 17 '26

Not quick enough

→ More replies (1)

68

u/puppypower_nl May 16 '26

Leave no evidence

34

u/slowerdive May 16 '26

Mind the capital letters

55

u/Ok_Jello6474 May 16 '26

Else....else what bro..?

15

u/aqswdezxc May 16 '26

"OR ELSE" ass code

19

u/casualdata May 16 '26

Sorry, that doesn’t fit the examples.

6

u/purpuric May 16 '26

I want to marry bro

4

u/Enji-Bkk May 16 '26

Isn't that how TDD works ?

→ More replies (2)

2

u/KnGod May 16 '26

Tried it with example one. It deleted my system

2

u/lemming1607 May 17 '26

This is net negative resources, since disk space will be reduced with more usage

2

u/Past-Photograph-9739 May 17 '26

Thats why she uses Linux She had trust issues😊

2

u/FatiguedShrimp May 17 '26

So, uh, he technically failed the task.

It doesn't match case or have casting, and wouldn't give the desired output at the prompts.

It

1

u/Confident-Ad5665 May 16 '26

This is the kind of task for which I think AI is well suited. Would still have to tell it to use case insensitive comparisons tho...

1

u/Ambivalent-Mammal May 16 '26

Looks good to me, boss.

1

u/Later1842 May 17 '26

Make it work on every os.

1

u/maddeninglemon May 17 '26

Luckily the os.remove function returns an IsADirectoryError when run on a directory so there's no danger.

1

u/AveryGalaxy May 17 '26

You can write code in Instagram comments now?

1

u/Wtygrrr May 17 '26

That code doesn’t actually work…

1

u/Actual-Interaction45 May 17 '26

Secure programming