Failing 3 test cases

Link to Code : https://ide.codingblocks.com/s/408128
Failing 3 test cases can’t figure out why

hey 2 things

  • array is not sorted so s will not always be a[n-1].
  • find max and then assign it to s