t2a19-leet-illia.html



  • Ask Chatgpt for a beginner friendly javascript Leet code question.

  • Record the question on this webpage

  • Write your code to solve the problem within Pre tags

  • Ask chatGPT to make an html javascript single file answer without any css


    1. Show your prompt here
      ...



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

    3. Within PRE tags show your version of the leet answer withour looking at the actual answer.
          This code is in the pre tag
               it save spaces and linebreak
                        For example this is shifted in
          
        


    4. Put the chatGPT working code here. (sensibly, it does not need several tags that are not used) Reverse String - JavaScript Practice

      🧩 Reverse String

      Problem: Write a function that takes a string s and returns it reversed.

      Example: Input: "hello" → Output: "olleh"



      Output: