We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0655995 commit 1e84f2dCopy full SHA for 1e84f2d
c++/main.cpp
@@ -253,9 +253,9 @@ intstr *sort_map(const strMap &m) noexcept
253
{
254
int i = 0;
255
auto arr = new intstr[m.size()];
256
- for (const auto &it : m)
+ for (const auto &[a, b] : m)
257
258
- arr[i] = make_pair(it.second, it.first);
+ arr[i] = make_pair(b, a);
259
i++;
260
}
261
sort(arr, arr + m.size(), greater<>());
@@ -273,9 +273,9 @@ strstrMap *sort_strmap(const statusMap &m) noexcept
273
274
275
auto arr = new strstrMap[m.size()];
276
277
278
- arr[i] = make_pair(it.first, it.second);
+ arr[i] = make_pair(a, b);
279
280
281
sort(arr, arr + m.size(), cmp);
0 commit comments