Python please

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Python please

Post by answerhappygod »

Python please
Python Please 1
Python Please 1 (73.78 KiB) Viewed 56 times
Python Please 2
Python Please 2 (32.93 KiB) Viewed 56 times
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 their heights appear in A). For the i-th student, if there is a row in which all the students are taller than A[], the student will stand in one of such rows. If there is no such row, the student will create a new row. Your task is to find the minimum number of rows created. Write a function that, given a non-empty array A containing N integers, denoting the heights of the students, returns the minimum number of rows created. For example, given A = [5, 4, 3, 6, 1], the function should return 2. Students will arrive in sequential order from A[D] to A[N-11. So, the first student will have height = 5, the second student will have height 4, and so on. For the first student, there is no row, so the student will create a new row. Row [5] For the second student, all the students in Row1 have height greater than 4. So, the student will stand in Row1. Row1 = [5,4] Similarly, for the third student, all the students in Rowl have height greater than 3. So, the student will stand in Row1. Row1 [5, 4, 3] For the fourth student, there is no row in which all the students have height greater than 6. So, the student will create a new row. Row1 = [5, 4, 3] Row2 = [6] For the fifth student, all the students in Row1 and Row2 have height greater than 1. So, the student can stand in either of the two rows. Python 3 Keyboard navigation: Use Tab to advance the cursor. To exit the editor, press the ctrl and keys. 1 import ays 2 3 4 5 6 7 8 9 10 10 11 12 13 14 15 16 17 17 de solution (A) ***Your solution goes here.*** det main() ***Read from stdin, solve the problem, write answer to atdout.**** input sya.stdin.readline().split() & int(x) for x in input[0].split!"," sys.stdout.write(strt solution (A))) if THITH - main : Bain!!
Forcemple, "A= 54,3% *I de ancien m2 Sturmwaminas s he-he-he A[4-15 socond count whoogh-4, and so o For de faststad 1. Trate de 10 109, we de studeni M Fall For the water, alles chats Fowow height Fow1. Fow 10.4 Sardeny. For die Und student, af de studenta in Jaral-www.bp. znsor Ian % 9, Palm A eral H F1-51,31 For the fourth suces there is no w MI suces have he gho greater than 6. 90, the cl. dent wilde How To 1-4 KAT-3.6 la Fete del site share-In Real an Fw-when-1 5,1 and in thereto Dow Row 1-5.4.2.1 Funz - As camasa, Itae Larasa Al -N len kogerwin the mags: 4.500 bachement of any Als an innger with oth range 10 00 1.Los on comesne T ARTÍSTRAT SAKLİ 241 metrar. Python3 Kobou dran gudan, Ube Tub to advance the cast att de autopren die nila sa [kuya, aut retus **war celular çoma aura. T soll fidget for 2 in malprospli-45,741 stanikalamikaj efektin www a
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply