Count Finished Tasks
This problem is based on a simple to-do list check. You have a list that shows whether each task is finished or not, and you want to know how many tasks are already done.
In this version, the list uses 1 for a finished task and 0 for an unfinished task. Your job is to count how many ones appear.
For example, if the list is [1,0,1,1], the answer is 3 because three tasks are already finished.
So the task is to scan the list and count how many finished tasks there are.
Example Input & Output
Three tasks are marked as finished.
An empty task list means there is nothing finished to count.
If nothing is finished, the count stays 0.
Algorithm Flow

Solution Approach
A clean way to solve this is to use a counter.
Start by creating a variable like finished_count and set it to 0.
Then go through the task list one value at a time. For each value, check whether it is equal to 1.
The condition is:
If that condition is true, increase the counter by 1.
After the loop ends, the counter holds the total number of finished tasks, so that is the answer you print.
This problem stays simple because each item is checked the same way.
Best Answers
Solutions Coming Soon
Verified best solutions for this Challenge are still being analyzed and will be available soon.
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this Challenge.
