Skip to content
CampusEduX

Check if an Array is Sorted

Easyjavapythonccppjavascript

Given an array of N integers, determine whether its elements are arranged in non-decreasing order.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

Print 1 if the array is sorted in non-decreasing order, otherwise print 0.

Related Problems

  • Find the Largest Element
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Find the Smallest Element
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Find the Second Largest Element
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...