Présentation du problème

Character Occurrences


Count the number of occurrences of a character in a string.

easy
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Identify the target character"
        },
        {
          "children": [],
          "goal": "Understand the string\u0027s composition"
        }
      ],
      "goal": "Analyze the string and the target character"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Traverse the string and tally matches"
        },
        {
          "children": [],
          "goal": "Summarize the final count"
        }
      ],
      "goal": "Compute the occurrence count"
    }
  ],
  "goal": "Determine the total count of a specified character in the given string"
}
    

Generated Goals

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

  • Assess whether the string is a palindrome
  • Analyze the string and the target character
  • Determine the maximum length of substrings that contain the target character
  • Analyze the frequency of all characters in the string
  • Traverse the string and tally matches
  • Compute the occurrence count
  • Identify the target character
  • Summarize the final count
  • Understand the string's composition