According to the algorithm discussed by Prateek bhaiya. We first have to sort the array and then check if difference between the consecutive chopsticks length is >=D. If yes, we can pair them but I want to know if we have a case like
1 3 6 where D=5. No doubt I cannot pair 1,3 but I can pair 1,6 right and if we go according to Prateek bhaiya’s logic I will mis this case.
Chopsticks from Greedy
U misunderstood the question