Solución

@moydeev·hace 6dTypeScript
solution.tsTypeScript
def starts_with(text: str, prefix: str) -> bool:
    newText = ""
    if prefix == "":
        return True

    for i in text:
        newText += i
        if len(newText) == len(prefix):
            if newText == prefix:
                return True
            else:
                return False
        elif len(text) < len(prefix):
            return False 

        
        
    
    
0respuestas
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.