Order Check (Backend)

Problem Overview

  • Given a list of student heights, determine how many are not in the positions they would be in ascending order.
  • Input: int array height[n]; Output: int count; Constraints: 1 ≤ n ≤ 100,000 and 1 ≤ height[i] ≤ 1,000,000,000.
  • Real-world context: arranging a class for a photograph by height.
  • This coding interview problem is an interview question from Canva interviews.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: