Approach to the problem

How to approach to this problem?

@tusharbhardwaj127 using two loops just check all the pairs and keep updating the answer. (as constraints are small so n^2 will be good)
i hope its clear if yes dont forget to hit like and mark resolved otherwise ask me :smiley: