Build your intuition. Click the correct answer from the options.
What is the output of the following code snippet?
TEXT/X-C++SRC
1vector<int> nums = {1, 4, 3, 2};
2sort(nums.begin(), nums.end());
3reverse(nums.begin(), nums.end());
4for (int i: nums) {
5 cout << i << ' ';
6}
Choose the best answer.
Click the option that best answers the question.
- 4 3 2 1
- 1 2 3 4
- 2 1 3 4
- 1 4 3 2