This code is giving the right answer as expected by the example output and other test cases but after submission answer is showing wrong for all test cases :-
#include
using namespace std;
int main () {
int a, b,max=0;
cin>>a>>b;
if (a>b) {
swap(a,b);
}
for (int x=a;x<b;x++) {
for (int y=x+1; y<=b; y++) {
if (x^y>max) {
max=x^y;
}
}
}
cout<<max<<endl;
return 0;
}