Cannot compile my solution in c++. Giving some error when I use STL's sort


#1

cannot compile my solution in c++. Giving some error when I use STL’s sort


#2

calling sort on an array modifies it, and as you can see we have been passed the array through constant reference so it can’t be modified, hence the error.