Comparater function Error or Something???

Revision en1, by Snapper_001, 2022-06-15 18:55:17

static bool comp(string a ,string b){ return a.size()<=b.size(); }

I used this in leetcode But this gives Error "terminate called after throwing an instance of 'std::length_error' "

after changing it to --> a.size()<b.size() this works How this works????

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Snapper_001 2022-06-15 18:55:17 313 Initial revision (published)