• 1
    Input and Output Data
    • Tasks
  • 2
    Conditions
    • Tasks
  • 3
    For Loop
    • Tasks
  • 4
    Strings
    • Tasks
  • 5
    While Loop
    • Tasks
  • 6
    Lists
    • Tasks
  • 7
    Two-Dimensional Arrays
    • Tasks
  • 8
    Dictionaries
    • Tasks
  • 9
    Sets
    • Tasks
  • 10
    Functions and Recursion
    • Tasks
  • к

Занятие 7. Two -dimensional arrays

Difficulty level:

Task«Are the SOW?»

The university is formed for each group for each group for the day. The schedule is presented in the form of a two -dimensional array (list of lists) of the lines, where the lines correspond to the numbers of the groups, and the columns & ndash; the time of the start of classes (for example, the first column & ndash; 8:00, the second & ndash; 9:30, etc.). In the cells of the array, the names of objects that will take place at this time with a particular group are recorded. If the group does not have a lesson at this time, then the cell records “freely”.
rn
it is necessary to determine how many temporary intervals, when there are at least two groups Free time.

Input format

first the integer & nbsp; n (1 & lt; n & nbsp; & le; 10) & ndash; The number of groups.
Then, a schedule for the day is entered for each group. Each line contains a schedule for one group. The schedule is a string consisting of the names of objects or the word "free", separated by spaces. The number of items in the schedule for each group does not exceed 10

Output format

to derive the one-number & ndash; The number of temporary intervals, when at least two groups have free time

Example

Input

3
Mathematics free physics
Free history free
Chemistry free physical education

Output

1

Hint

There will be no clue here, decide for yourself!

main.py
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Test 7
Test 8
Test 9
Test 10
Developer’s solution

🎉 Congratulations! 🎉

You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.

AD

Advertisement

red-snake blue-snake green-snake

Running your code...

Помощник ИИ

Привет! Я твой помощник по программированию. Задавай любые вопросы по Python, я могу рассказать о функциях, методах, обьяснить то, что тебе не понятно, а так же о текущей задаче!