I used sorting and checked for adjacent elements difference is less tan k but I got wrong asnwer for some hidden testcaes can someone help me with this