Présentation du problème

Merge Arrays


Merge two sorted arrays into one sorted array.

medium
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Compare current elements to decide which to append"
        }
      ],
      "goal": "Align elements from both arrays"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Ensure all elements are included and order is maintained"
        }
      ],
      "goal": "Finalize merged array"
    }
  ],
  "goal": "Merge two sorted arrays into a single sorted array"
}
    

Generated Goals

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

  • Verify that both arrays are sorted before merging
  • Compare current elements to decide which to append
  • Optimize memory usage by reusing the input arrays
  • Ensure all elements are included and order is maintained
  • Align elements from both arrays
  • Finalize merged array
  • Determine the maximum length of the two arrays