(mid, nums, count = 0)
| 46 | }; |
| 47 | |
| 48 | const getCount = (mid, nums, count = 0) => { |
| 49 | for (const num of nums) { |
| 50 | /* Time O(N) */ |
| 51 | const isMidGreater = num <= mid; |
| 52 | if (isMidGreater) count++; |
| 53 | } |
| 54 | |
| 55 | return count; |
| 56 | }; |
| 57 | |
| 58 | /** |
| 59 | * https://leetcode.com/problems/find-the-duplicate-number/ |