Three dots are a folder.
transcript
The path is slash a, slash three dots, slash b. The answer keeps all three parts. Your code returns slash b. Where did the a go?
The code asks if a part starts with two dots. Three dots start with two dots. Yes. So it treats them as a move up. It pops a. Then b is pushed.
Test for exactly two dots. Three dots are not exactly two. So they are a folder name. Push them. Then b is pushed. The path is a, three dots, b.
One dot means stay. Skip it. Exactly two dots mean go up. Everything else is a name. Compare for an exact match.
Hidden files start with a dot. Some folders end with two dots. All of them are plain names.
Test for exactly one dot or two dots. Everything else goes on the stack. Hidden files are names too. Full breakdown in the lecture.