Cosmovex Tools

Want to solve LeetCode-style problems with friends? Race two solutions in one room

LeetCode with friends with PairPad

The pad opens with one classic problem, the longest substring without repeating characters, and two empty solution slots, solveA and solveB. Each Run checks both against six cases and times them on a 52,000-character string, so a brute-force answer and a sliding window can race side by side in the shared console.

  1. Press Share and send the link to your friend. You both join the same race.js; each of you takes one of solveA and solveB.
  2. Code your function. You see each other's cursors, so agree not to peek, or pair on one solution and take turns at the keyboard.
  3. Press Run (Ctrl/Cmd+Enter). Both functions are checked on six cases (including the empty string and a single space) and timed on 52,000 characters; the results appear in the console for both of you.
  4. Compare: a brute force usually passes but takes far longer on the big input than a one-pass sliding window. Explain each other's solution before moving on.
  5. For the next round, replace race.js with a problem from next-problems.md and keep the harness; a free room keeps 2 files, Pro has no file limit.
leetcode with friends leetcode compete with friendsleetcode pairingsolve coding problems with friends onlinepractice coding problems together onlineleetcode together real time
Open PairPad Free · Pro $29 one-time · no account

What to know

This is not connected to LeetCode: there is no problem catalogue, account sync or judge. It is a shared room where you paste a problem, write solutions side by side and check them against the same test cases, which is what most people mean by doing LeetCode with friends. Nobody needs an account or a browser extension, and the session costs nothing beyond sending a link.

The race harness is deliberately small so you can copy it to any problem: two functions, an array of [input, expected] pairs, and a timing line with performance.now() on one large input. Timing in a browser is noisy, so read the numbers as orders of magnitude: on this input a correct sliding window takes a couple of milliseconds, while a brute force that restarts at every index takes tens. The gap grows with the length of the runs of distinct characters in the input.

The six cases include the ones that catch real bugs: the empty string (0), a single space (1, because a space is a character), "pwwkew" (3, and "pwke" is a subsequence, not a substring), and "dvdf" (3), which breaks sliding windows that reset the start to the wrong index after a repeat. The correct update is start = max(start, lastSeen + 1).

Code runs in a sandbox in the browser of whoever presses Run, in JavaScript or TypeScript; Python can be written for discussion but does not run here. A solution with an infinite loop is stopped after five seconds without freezing anyone's tab. Free rooms are deleted 24 hours after the last activity and hold 3 people at once, so a room is one practice session; Pro keeps rooms permanently with up to 10 people.

Updated · Cosmovex

Questions

Is this connected to my LeetCode account?

No. It is a separate shared editor. Paste the problem statement and the examples into a file, write your solutions there and submit to LeetCode yourself if you want it judged.

Can we use Python?

You can write and discuss Python, but it does not run in PairPad. JavaScript and TypeScript run with a shared console, so the race harness works in those.

How many friends can join?

Up to 3 people at once can join a free room from the link and edit; a Pro room holds 10. Each person shows up with their own name and cursor colour, and the console output is shared with everyone.

Why is "pwwkew" 3 and not 4?

The answer must be a contiguous substring. "wke" is the longest without a repeat; "pwke" skips a character, so it is a subsequence.

Are the timings fair between two people?

Both functions run in the same Run, on the same machine and input, so the comparison inside one run is fair. Numbers differ between computers, so compare ratios rather than milliseconds.

The free plan covers everything on this page. PairPad Pro ($29, paid once) is described on the PairPad page.