You are viewing a single comment's thread. Return to all comments →
while taking input just replace any number greater than n with "n" fr(n){ cin >> temp; arr[i] = temp > n ? n : temp; }
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Swaps 2
You are viewing a single comment's thread. Return to all comments →
while taking input just replace any number greater than n with "n" fr(n){ cin >> temp; arr[i] = temp > n ? n : temp; }