Help needed with Arrange The Dates(SSEC0004)

https://www.codechef.com/viewsolution/37966440

Why am I getting WA in this solution, whereas a similar approach by another user has AC : https://www.codechef.com/viewsolution/37984594

Link to Problem : Arrange the Dates