“REDUCE” .compareTo(“REVOLT”) + “ANTARTICA” lastIndexOf(‘A’)


Solution



Here compareTo() function returns the difference in two strings if they are not equal,if they are equal then returns zero

So, “REDUCE” .compareTo(“REVOLT”) results to 68-86

and, “ANTARTICA”.lastIndexOf(‘A’) results to 8

On adding these two (68-86)+8
=>-18+8
=>-10,this is the result


Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com