Created
April 20, 2020 08:43
-
-
Save ThienTranDuy/f1afcd683fb41608add231d13095ce5c to your computer and use it in GitHub Desktop.
Hackerrank challenge - Birthday Cake Candles - https://www.hackerrank.com/challenges/birthday-cake-candles/problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function birthdayCakeCandles($ar) { | |
$candles = array_count_values($ar); | |
ksort($candles); | |
$candleLast = array_key_last($candles); | |
$tallestCandels = $candles[$candleLast]; | |
return $tallestCandels; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment