Stable Money interview question

gfg puzzles , Graphs DSA questions asked.