Array Is Sorted Check Problem

Array Is Sorted Check Problem — ExecCode School DSA Practice

Solve the Array Is Sorted Check problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a whole number for the problem Array Is Sorted Check. Your task is to check if these numbers are sorted from smallest to largest. You will first get how many numbers are in a list, then the list of numbers itself. If each number is the same or bigger than the one before it, print "true". Otherwise, print "false".

Examples

Input 5 1 2 3 4 5; Output True. Input 5 5 4 3 2 1; Output False

Constraints

1 <= n <= 10^5

Practice Array Is Sorted Check free on ExecCode. Browse DSA problems, topic map, and placement guides.