Solución
solution.tsTypeScript
export function extractNumbers(str: string): number[] {
const regex = /\d+/g;
const matches = str.match(regex);
return matches ? matches.map(Number) : [];
}0respuestas
export function extractNumbers(str: string): number[] {
const regex = /\d+/g;
const matches = str.match(regex);
return matches ? matches.map(Number) : [];
}Aún no hay respuestas
¡Sé el primero en responder!
Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.