So Currently I\'m stuck at a question. first I\'ll give the question below then I\'ll give my own algorithm for solving it. but the problem is that it is too slow. Any Help Woul