Skip to content · ⁨Pular para o conteúdo⁩

Smallest and largest · ⁨Menor e maior⁩

English

Smallest and largest

Find both ends of a list in a single pass.

Keep two values at once, both starting as the first item. Check each number against both: it may replace the smallest, the largest, or neither.

Português

Menor e maior

Encontre ambas as extremidades de uma lista em uma única passagem.

Mantenha dois valores de uma vez, ambos iniciando como o primeiro item. Verifique cada número contra ambos: ele pode substituir o menor, o maior ou nenhum dos dois.

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP