BDGFT - Editorial

Finally solved it :hot_face:. Am glad I thought the editorialist approach on my own.
Here is my solution
All the suggestions are welcomed :grin:

@taran_1407
Can we also solve this problem using two pointer approach? if yes can anyone guide me in implementing it, please? and if no, can you give viable reasons, please …