Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int left = 0;
- int right = 0;
- while(right < n){
- if (answer[right] == ' ') {
- int tmp = right - 1;
- while(left < tmp){
- std::swap(answer[left], answer[tmp]);
- left++;
- tmp--;
- }
- left = right + 1;
- }
- right++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement