Array form biggest number

please point out the mistake in my code, it shows error on submitting

Hi @sam15jain, problem with your code is :

  1. Sort function is incorrect. Some unnecessary operations are being performed.
  2. The swap function demands int but you are passing a character and array. The fact it is working here because it takes the ASCII value of the starting character of the strings/char arrays passed.

I recommend you to use the string and STL sort function for this question. It will ease your task of writing the code.

Hope this helps :slight_smile:

1 Like