A LeetCode tutor that talks it through.
Explain your approach out loud, get a hint when you’re stuck, and keep every problem you solve. On Mac and iPad.
- Follows the problem you open
- Sees your test runs
- Hints, never the answer unasked
167. Two Sum II
MediumGiven a 1-indexed array of integers numbers sorted in non-decreasing order, find two numbers that add up to target.
Input: numbers = [2,7,11,15], target = 9 Output: [1,2]
Input: numbers = [2,3,4], target = 6 Output: [1,3]
Your tests fail twice. Buddy noticed, and waits. Still stuck? A quiet card with the failing case. When it passes, it’s your win.
A friend who’s seen it before.
Buddy works each problem out quietly in the background, so the right hint is ready the moment you want it.
Talk through your approach.
Say your idea out loud, the way you would in an interview. Buddy listens, asks what you’d try next, and answers in a sentence or two.
Ask it to draw it out.
Two pointers, a tree, a DP table: on iPad, Buddy draws it on your page, in its own ink.
LeetCode, beside your notes.
On iPad, say “pull up LeetCode” and the problem opens next to your page. Buddy follows along there too.
Every problem becomes review.
Each session is written into your notes: how you solved it, and questions for next time. Review cards with spaced repetition keep the patterns fresh.
#Two Sum II
Given a sorted array and a target, return the two positions whose values add up to the target.
def two_sum(nums, target):i, j = 0, len(nums) - 1while i < j:s = nums[i] + nums[j]if s == target: return [i + 1, j + 1]if s < target: i += 1else: j -= 1
Constraints
- , exactly one solution
- Use only constant extra space
It helps you learn. It won’t do it for you.
Buddy works the problem out quietly in the background, then gives you the smallest help that gets you moving again.
How do you want to work?
Talk it through together, or have a go on your own first.
A nudge
A question that points you the right way, from hints Buddy prepared in the background.
Point at the spot
The exact line on your page, or in your code.
Explain the idea
On a card or a diagram, not a lecture.
The full solution
Only when you ask for it.
Silence is thinking time.
Buddy never talks over you or comments while you work. Over a long session, it speaks only a handful of times.
Questions, answered.
Yes. Pen Buddy is a study notebook for Mac and iPad with a voice tutor, Buddy, that helps you practise LeetCode the way a friend would: it follows the problem you have open, listens while you talk through your approach, and gives you the smallest hint that gets you moving. It won’t write the solution for you unless you ask.
No. Buddy works the problem out quietly in the background, then helps one step at a time: a question to nudge you, a hint, a pointer to the exact line, the idea explained on a card or a diagram. The full solution comes only when you ask for it.
It is when the AI helps you think instead of thinking for you. The struggle is where a pattern sticks, so Buddy stays quiet while you work, gives hints before answers, and celebrates only what you solved yourself. Pen Buddy is built for practice and learning.
On the Mac, share your screen once for the conversation. Buddy reads the problem from the page in your browser, follows your code, and sees your test runs: what passed, what failed and the failing case. A “Screen shared” badge with a stop button is always showing. On iPad, it follows the study browser inside Pen Buddy.
Yes, that’s the heart of it. Explain your idea out loud and Buddy listens, asks what you’d try next, and answers in a sentence or two. Interrupt it any time and it stops. It’s good practice for explaining your thinking in a real interview.
Yes. Say “pull up LeetCode” and the study browser opens beside your note. Work the idea out by hand with Apple Pencil, and ask Buddy to draw two pointers, a tree or a DP table right on your page.
LeetCode runs in your browser. Pen Buddy is a Mac app that works alongside it: open a problem in your browser, share your screen, and Buddy follows along. Press ⇧⌘Space from any app to talk.
Yes. Each session is written into your notes: the problem, how you solved it and review questions, like “Which pointer moves when the sum is too big?”. Buddy turns them into review cards with spaced repetition, so patterns stick between sessions.
Whatever you code in: Python, Java, C++, JavaScript and more. Topics from arrays, strings and two pointers to trees, graphs and dynamic programming.
The notebook is free, with 25 credits a month to try Buddy. A credit is about one question. Regular $9.99 a month (300 credits), Heavy $24.99 a month (1,000 credits), Research $49.99 a month (2,500 credits).
LeetCode is a trademark of LeetCode LLC. Pen Buddy isn’t affiliated with or endorsed by LeetCode.
Pen Buddy
Everything you need to study, and someone to study with.