Riddles with matrices

Puzzles, riddles, brain teasers, conundrums, logic questions in pictures. Here all tasks are presented in the form of various matrices. Most often these are rectangular matrices that have external rows and columns. In these logic puzzles, brain teasers and conundrums, the columns and rows affect the contents of the matrices. To check your answer, click on the «Answer» button located below the task. After this, the correct answer and explanations will appear. Below you can select other questions on this topic. Typically each topic has 20 questions or more. At the same time, the complexity of logical problems gradually increases. First there will be easy questions, then medium, then difficult. Try to complete tasks as quickly as possible.
Question - 5
In this brain teaser, you need to replace the question mark surrounded by a circle with intelligence. You must understand the rule by which the numbers are placed at the top and to the right of the overall image.
Correct answer = 0.
The number at the top is equal to the number of objects in the column colored with the same color as the number. The number on the right is equal to the number of objects in the line that are colored the same color as the number.
-----------------------------------------------------------------------------------------------------------------------------