sorting.cpp: In function 'bool check(std::vector<int>, int, int)':
sorting.cpp:16:14: warning: unused variable 'i' [-Wunused-variable]
16 | for (int i : p) {
| ^
sorting.cpp:30:16: warning: declaration of 'auto& x' shadows a parameter [-Wshadow]
30 | for (auto &x : swaps) {
| ^
sorting.cpp:5:31: note: shadowed declaration is here
5 | bool check(vector<int> p, int x, int n) {
| ~~~~^
sorting.cpp:35:24: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
35 | while(swaps.size() < x) {
| ~~~~~~~~~~~~~^~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:55: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]
55 | for (int i = 0; i < ans.size(); i++) {
| ~~^~~~~~~~~~~~
sorting.cpp:59:20: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
59 | return ans.size();
| ~~~~~~~~^~