Présentation du problème

Anagram


Check whether two strings are anagrams.

medium
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Count characters in the first string"
        },
        {
          "children": [],
          "goal": "Count characters in the second string"
        }
      ],
      "goal": "Compute character frequency counts for each string"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Check that all character counts match"
        },
        {
          "children": [],
          "goal": "Confirm no extra characters are present"
        }
      ],
      "goal": "Compare the frequency counts to verify anagram status"
    }
  ],
  "goal": "Determine if two strings are anagrams"
}
    

Generated Goals

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

  • Count characters in the first string
  • Confirm no extra characters are present
  • Check that all character counts match
  • Compare the frequency counts to verify anagram status
  • Count characters in the second string
  • Verify that both strings contain only alphabetic characters
  • Check if the strings have the same length
  • Determine if the strings are palindromes
  • Compute character frequency counts for each string