Question: 7-Python-SynchronizingLists Highest grade Problem Statement As you know, it is often difficult to keep everything in order! In this problem, suppose you have two lists




7-Python-SynchronizingLists Highest grade Problem Statement As you know, it is often difficult to keep everything in order! In this problem, suppose you have two lists of numbers, each with length n, and you want the lists to be synchronized. The two lists are defined as synchronized if the second list is in the same "order" as the first list. For example, suppose you are given lists [48, 10,97] and [7, 46, 20). Note that the first list has the smallest number (10) at index [1], the largest number (97) at index [2], and the middle number (48) at index [0]. Thus, to put the second list in the same "order" as the first list, the second list should become [20, 7, 46), so the smallest number of the second list is at index[1], the largest number of the second list is at index [2], etc. Notes No list contains duplicates. . All list elements will be integers. Hint: Use the sort function to know which numbers from both lists should go together. Then change the ordering of the original second list so it matches the original first list. The input is two lines of integers of length nisn s 5000, each delimited by a space. Output the synchronized second list so that it has the same "order" as the first list. Submit 7-Python-SynchronizingLists Highest grade: Notes No list contains duplicates. All list elements will be integers. Hint: Use the .sort() function to know which numbers from both lists should go together. Then change the ordering of the original second list so it matches the original first list. The input is two lines of integers of length 1 sn s 5000, each delimited by a space. Output the synchronized second list so that it has the same "order" as the first list. Sample Input 1 48 10 97 7 46 20 Sample Output 1 [20, 7, 46] Submit 8-Python-ConcertSeats Highest grade o Problem Statement You have been invited to attend a concert with your buddy Tom Cruise, who got the two of you premium seats on the floor of the venue close to the stage! However, the floor seats are not elevated like the stands (they are all at the same height) and you want to make sure that you will be able to see the stage from your seats. Given a 2D array with the layout of the floor of a concert hall and the height (in dwillyinches, a logarithmic measurement of height) of each concert attendee, write a program that determines if every attendee can see the front stage. An attendee can see the front stage if they are strictly taller than all of the attendees in front of them. Submit 8-Python-ConcertSeats Highest grade Everyone can see the front-stage in the example below: # FRONT STAGE [[1, 2, 3, 2, 1, 1], [2, 4, 4, 3, 2, 2], [5, 5, 5, 5, 4, 4], [6, 6, 7, 6, 5, 5]] # Starting from the left, the 6 > 5 > 2 > 1, so all four of these atte ndees can see. # 6 > 5 > 4 > 2 so all four of these attendees can see, etc. Not everyone can see the front-stage in the example below: # FRONT STAGE [[1, 2, 3, 20, 1, 1], [2, 4, 4, 3, 2, 2], [5, 5, 5, 10, 4, 4), [6, 6, 7, 6, 5, 5]] # The 10 is in front of the 6 and blocking its view; also the 20 block s the 3, 18, and 6. Submit 8-Python-ConcertSeats Highest grade: Your program should print True if every number i.e., attendee) can see the front-stage, and False if even a single number/attendee cannot. The input starts with n, the number of rows in the concert. Following this first line is n rows, each of them a space delimited row of seats in the concert hall. There will always be the same number of columns (i.e., seats) in each row. Assume the stage is always at the position shown in the examples above (the front) Sample Input 1 3 1 2 4 5 7 8 Sample Output 1 True Sample Input 2 Submit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
