t2a19-leet-andy.html


  • Show your prompt here
  • This is a beginner LeetCode-style problem about strings.


  • Show the Leet question here
  • Write a function that takes a string as input and returns the reversed string.

    Example:

    Input:  "string"
    Output: "gnirts"
    

  • Your attempt
  • let str = "string";
    let reversed = str.split("").reverse().join("");
    document.getElementById("rev-output").innerHTML = reversed;
    
    Click the button to see the result...