Answer the question
In order to leave comments, you need to log in
How to prepare for the 27th task of the exam in Python?
In principle, I appeal to those who passed / passes the exam in computer science. I write everything in Python and faced with the fact that there is a big difference in complexity between task 27 and all the others. I am preparing according to Polyakov's reference book, he has answers to the 27th task in Python, but they look tricky and there are no comments on which line does what. I took Python courses on Stepik and GeekBrains, it's still hard to decipher his solutions.
What sources did you use to prepare for this assignment: articles, reference books, etc., other than Polyakov?
Answer the question
In order to leave comments, you need to log in
The main essence of the 27th task is the development of a correct algorithm (to get the maximum score) and its implementation in a specific language. Deep knowledge is not needed there, basic functions / operations are enough for the solution. It seems to me that more emphasis in preparation should be placed on algorithms. Well, solve as many of these tasks as possible.
infbu.ru/catalog/1027
On the example of this task:
All received data can be represented as a list of non-negative integers. You are required to go through this list with a box of width 5 and calculate the amount in each box.
For example:
The first box is items 0 to 4, the second is items 1 to 5, the third is items 2 to 6, and so on up to the box (n-4) to n, each with 5 items.
Get a special variable where you will store the maximum, with each shift of the window, compare the current amount with the maximum, if it is more than the existing one, then this is your new maximum.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question