Extremal polynomials in stratified groups