Skip to content
dreamcode
dreamcode
Peaks
Cloud Hopper
BeginnerJavaScript
Reward: +40 XP
PROBLEM

Cloud Hopper

You're hopping across the sky, but you can only land on clouds that rise above height k. Given a list of cloud heights, return how many clouds you can land on.

Examples
countTallClouds([3, 7, 2, 9], 5)
2
countTallClouds([], 4)
0
solution.js
JAVASCRIPT
Saved as you type

Tests

0 of 3 passing
  • [3,7,2,9], k=5 → 2
    countTallClouds([3, 7, 2, 9], 5)
    expected 2
  • [], k=4 → 0
    countTallClouds([], 4)
    expected 0
  • [5,5,5], k=5 → 0
    countTallClouds([5, 5, 5], 5)
    expected 0
On the line
+40 XP
Pass all 3 tests to claim it.