Why this code is giving NZEC error

I have cross checked my code like so many times

(CodeChef: Practical coding for everyone)

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’.

2 Likes

Thanks :slight_smile: it was such a silly mistake XD

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