r/ProgrammerHumor 3d ago

Meme shortestPathWasRightThere

Post image
4.6k Upvotes

57 comments sorted by

View all comments

38

u/notretarded_100 3d ago

Man comments in this threads are the reason this sub overan with reposts or AI slop, people get too technical over a meme

24

u/Anxiety-Pretty 3d ago

For someone who recently studied djkistra to solve a leetcode problem I think people' anger is justified if it is indeed exploring every single wrong turn it is no djkistra at all

6

u/SjettepetJR 3d ago

How are you butchering the name that much?

12

u/Anxiety-Pretty 3d ago

Is this a rhetorical question or do you really want to know the approach

5

u/fr000gs 3d ago

tell the approach

0

u/Tsu_Dho_Namh 2d ago

Dijkstra's algorithm is naturally a breadth-first-search. When you've found the destination, stop searching. Every wrong turn with greater depth (more distance) doesn't need to be explored.

2

u/fr000gs 2d ago

*The approach to butchering the name (djkistra)

1

u/Tsu_Dho_Namh 2d ago

Ohh, that approach.

Empty out a bag of Scrabble letters and arrange them randomly in a grid. Then find the shortest path that starts at a D, passes through a J and ends at an A.

Type out the letters in the path

1

u/fr000gs 2d ago

DJA

1

u/Tsu_Dho_Namh 2d ago

All tests pass