as i studied your code acc to me your max method will also not work for every case.







why you are writing size()>=1