You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive by one, sequentially(as the heights appear in A). For the ith student, if there is a row in which all the students are taller than A[i], the student will stand in one of such rows. If there's no such row, the student will create a new row. Your task is to find the minimum number of rows created.Write a function def solution(arr) that given a non-empty array A containing N integers, denoting the heights of the students, return the minimum order of rows created.

Solved
Show answers

Ask an AI advisor a question