Legend has it that Sasquatch, the elusive creature of the forest, has been collecting shiny rocks in his secret stash located deep in the woods. As curious adventurers, we've stumbled upon what we believe to be that very same stash. To avoid disturbing Sasquatch, we must carefully count the rocks in his stash without disturbing them. Sasquatch has a preference for larger rocks, so we've been tasked with counting only the rocks that are larger than 5 units in size.
Image generated by Microsoft Copilot.
Write a program that takes a list of numbers representing the sizes of rocks in Sasquatch's stash and calculates the total number of rocks that are larger than 5 units in size.
Input/Output
Example Input:
[3, 8, 6, 4, 10, 7, 2]
Expected Output:
Number of rocks larger than 5 units: 4