LeetCode and coding interviews

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
leetcode.com/problems/two-sum-ii-input-array-is-sorted
Screen shared Stop

167. Two Sum II

Medium

Given 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]
1class Solution:
2 def twoSum(self, nums, target):
3 i, j = 0, len(nums) - 1
4 while i < j:
5 s = nums[i] + nums[j]
6 if s == target: return [i + 1, j + 1]
7 if s < target: j -= 1
8 else: i += 1
Test resultRun
End
Listening

Your tests fail twice. Buddy noticed, and waits. Still stuck? A quiet card with the failing case. When it passes, it’s your win.

How it works

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.

Press ⇧⌘Space from any app

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.

Library
All Notes18
My Notes14
Study Sessions4
Problems2
PDFs1
Review6
Folders
Algorithms7
Calculus5
Finance2
Organic Chemistry2
All Notes
Two Sum II12:40 AMSorted array, find two numbers… Problem
Coin ChangeYesterdayFewest coins that make up… Problem
October 7, 2026 at 10:55 AM
NoteSessionsBrief

#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) - 1​
while i < j:​
s = nums[i] + nums[j]​
if s == target: return [i + 1, j + 1]​
if s < target: i += 1​
else: j -= 1​

Constraints

  • 2≤n≤3⋅1042 \le n \le 3\cdot10^4, exactly one solution
  • Use only constant extra space
Talk to Buddy⇧⌘Space
How it helps

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.

1

How do you want to work?

Talk it through together, or have a go on your own first.

2

A nudge

A question that points you the right way, from hints Buddy prepared in the background.

3

Point at the spot

The exact line on your page, or in your code.

4

Explain the idea

On a card or a diagram, not a lecture.

5

The full solution

Only when you ask for it.

Quiet by default

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.

 You’re working. Buddy’s quiet.
FAQ

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).

Pen Buddy

Everything you need to study, and someone to study with.