Conceptual illustration of opposing spotlights highlighting a pair of tiles on notebook paper.

Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.

Two-Pointer Pair Search from Array Notes

Convert sorted-array notes into a pair-sum walkthrough with explicit pointer movement.

Prompt

Transform the uploaded photo of handwritten algorithm notes into a clean, readable visual walkthrough. Treat the photo as the source of truth: preserve its algorithm, legible input values and stated conventions; remove glare, skew and paper clutter while retaining a small source-note inset. Do not invent unreadable values or silently repair contradictory logic; ask one focused question if an essential detail cannot be read. Use the optional example below only when the source has no worked example and label it "Illustrative example". Require a sorted ascending array and two distinct indices. At each panel show left, right, their sum and the comparison with target; move left rightward for a low sum or right leftward for a high sum. Optional labeled example: [1, 2, 4, 7, 11], target 9; pairs (1,11)=12, (1,7)=8, (2,7)=9; return indices 1 and 3 using zero-based indexing. Stop if left>=right. Preserve original input and flag unsorted input rather than silently sorting when original indices matter. State O(n) time and O(1) auxiliary space for already sorted input. Layout: Create three horizontal array panels with opposed labeled pointer markers; keep discarded ranges subdued and the successful pair outlined. Use an off-white canvas, dark high-contrast sans-serif labels and spacious cells. Include the algorithm title, input, numbered steps, final result and the stated complexity note. Pair colors with labels or outlines so meaning does not depend on color alone. Keep all values and state changes consistent across panels. If space is tight, simplify decoration rather than omitting essential steps. Output one polished educational image; treat it as a visual explanation, not executable code. Before finalizing, check the trace and all visible labels against the source.
Recommended: ChatGPT
Upload your photo to the AI tool first, then use this prompt. The prompt asks the model to preserve identity and key visual features.

How to use it

  1. Upload a clear photo of the relevant handwritten algorithm notes.
  2. Paste this prompt and specify any required input or indexing convention.
  3. Check the rendered values and labels against your source before publishing.

Common failure fixes

  • If the same index supplies both values, enforce left<right.
  • If pointer movement contradicts the sum, advance left for too small and retreat right for too large.
  • If input order changes without notice, restore it and flag the sorted-input requirement.