Présentation du problème

Reverse a String


Write an algorithm that reverses a string.

easy
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Determine the length and character positions"
        }
      ],
      "goal": "Analyze the input string structure"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Map original indices to reversed positions"
        }
      ],
      "goal": "Formulate the reversed string construction"
    }
  ],
  "goal": "Reverse a string"
}
    

Generated Goals

Mixed goals generated by the LLM (correct + distractors).

  • Formulate the reversed string construction
  • Check for null input
  • Determine the length of the string
  • Validate that the string contains only alphabetic characters
  • Map original indices to reversed positions
  • Determine the length and character positions
  • Analyze the input string structure