<table>
<tr>
<td style="position: relative; width: 100px">
<div style="position: absolute; left: 0px; width: 220px;">valid from</div>
<div style="position: absolute; left: 280px; width: 120px;">valid from</div>
</td>
<td style="width: 100px"></td>
<td style="width: 100px"></td>
</tr>
</tr>
问题出在这里 - https://www.hackerrank.com/challenges/birthday-cake-candles/problem
答案 0 :(得分:0)
无需对数组进行排序,您可以在 O(n) 次中解决问题
function birthdayCakeCandles(arr, n) {
var total = 0;
var len = arr.length;
for (var i = 0; i < len; i++) {
if (ar[i] === n)
total++;
}
return total;