Check if Array is Sorted Ascending
mediumQuestion 384An array is sorted in non-decreasing order when every element is greater than or equal to the one before it (equal neighbors are allowed). For the array {2, 4, 4, 8}, this holds, so print exactly the output shown in Expected Output.
If any element were smaller than its predecessor you would print No instead. Print Yes or No with no newline.
Expected output
Yes= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.