Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
Problem-Solving Trio

One day three best friends Bill, Bob, and Jane decided to form a team and take part in programming contests. During these contests, participants are typically given several problems to solve.

Before the competition began, the friends agreed on a rule:

They would only attempt to solve a problem if at least two of them were confident in their solution. Otherwise, they would skip that problem.

For each problem, it is known which of the friends are sure about the solution. Your task is to help the friends determine the number of problems they will attempt to solve based on their rule.

Given a list of lists of triples of integers 1 or 0. If the first number in the line equals 1, then Bill is sure about the problem's solution, otherwise he isn't sure. The second number shows Bob’s view on the solution, the third number shows Jane’s view. Return an integer - the number of problems the friends will implement on the contest.

Example 1

Input:

[[ 1, 0, 1 ], [1, 1, 1], [0, 0, 0]]

Output:

2

Example 2

Input:

[[0, 1, 1], [0, 0, 1], [1, 1, 1], [1, 1, 0]]

Output:

3
main.cpp

main.cpp

C++

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt