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.
Migratory Birds
Migratory Birds
Sort by
recency
|
3490 Discussions
|
Please Login in order to post a comment
PYTHON
` from collection import Counter
def migratoryBirds(arr):
`
Python:
JAVA
def migratoryBirds(arr): # Contar as frequências dos elementos na lista qtde = Counter(arr)
return error lvl 4 .. anyone can help me?
c++ 11 int migratoryBirds(vector arr) { vector a(5); int temp1 = 0; int temp2 = 0; int result = 0; for(int i=0;i
for(int j=0;j<1;j++){ int temp = a[0]; for(int k=1;k<5;k++){ if(temp < a[k]){ temp = a[k]; temp1 = k+1; } } for(int k=1;k<5;k++){ if(k != temp1){ continue; }else if(temp == a[k]){ temp2 = k+1; if(temp1>temp2){ result = temp2; } } } } if(result != 0){ return result; }else{ return temp1; } }