We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
funcinitAcumulator()[]int32{varnumAcumulator[]int32fori:=0;i<5;i++{numAcumulator=append(numAcumulator,0)}returnnumAcumulator}funcfindBiggest(accumulator[]int32)int32{varmaxint32varresultint32fori,e:=rangeaccumulator{ife>max{result=int32(i)max=e}}returnresult+1}funcmigratoryBirds(arr[]int32)int32{// Write your code hereaccumulator:=initAcumulator()for_,e:=rangearr{accumulator[e-1]++}returnfindBiggest(accumulator)}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
Solution using golang: