sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:24:28: warning: declaration of 'ans' shadows a global declaration [-Wshadow]
24 | vector<pair<int, int>> ans;
| ^~~
sorting.cpp:4:24: note: shadowed declaration is here
4 | vector<pair<int, int>> ans, xy, swaps;
| ^~~
sorting.cpp:34:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
34 | for (int i = 0; i < ans.size(); i++) {
| ~~^~~~~~~~~~~~
sorting.cpp:38:20: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
38 | return ans.size();
| ~~~~~~~~^~