Comparater function Error or Something???

Правка en1, от 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????

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Snapper_001 2022-06-15 18:55:17 313 Initial revision (published)