Essa empresa é sua?
Return the second-smallest element of a list.
Sigiloso
This can be done in following ways - Using collections: Collections.min(list); - Simple iteration: for (int i : array){ min = min < i ? min : i; }
Put in a max heap, pop the max, the top is now the second max.
#Python3 lst=[8,7,1,2,3,4,5] sorted(lst)[-2] #output is 7
pair a = (v[0] a.second) continue; if (*it < a.first) { a.second = a.first; a.first = *it; } else if (*it < a.second) { a.second = *it; } } return a.second;
Fique por dentro de todas as oportunidades e dicas internas seguindo as empresas de seus sonhos.
Comece a buscar vagas para receber atualizações e recomendações personalizadas.