Problem lengthsort
User P55D2K
Submission Time 2023-11-19 21:20:46
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In lambda function:
lengthsort.cpp:19:28: error: ‘v’ is not captured
19 | for (string it : v) {
| ^
lengthsort.cpp:17:31: note: the lambda has no capture-default
17 | sort(v.begin(), v.end(), [](string a, string b) {
| ^
lengthsort.cpp:12:20: note: ‘std::vector<std::__cxx11::basic_string<char> > v’ declared here
12 | vector<string> v(n);
| ^