sorting.cpp: In function 'bool check(int)':
sorting.cpp:16:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
16 | for(int j=0;j<=x&&j<swaps.size();j++)
| ~^~~~~~~~~~~~~
sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:59:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
59 | for(int i=0;i<moves.size();i++)
| ~^~~~~~~~~~~~~
sorting.cpp:63:19: warning: conversion from 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
63 | return moves.size();
| ~~~~~~~~~~^~
sorting.cpp:58:7: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
58 | check(ans);
| ~~~~~^~~~~