Why this code is giving NZEC error


#1

I have cross checked my code like so many times

(https://www.codechef.com/viewsolution/24042574)


#2

Click here.

  1. Object last(): This method will return last element in TreeSet if TreeSet is not null else it will throw NoSuchElementException.

In case if there is no element in the TreeSet you should output ‘-1’.


#3

Thanks :slight_smile: it was such a silly mistake XD


#4

if you can then please help me or plz forward the same to someone you know can help me! :smile: