Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .claude/skills/leetcode-solution-page/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ lessons the taller column went either way, and the fix that suited x-sum
made most pages worse. Script the measurement in a browser, and when the
choice changes how pages look, show a before and after.

**Write the prose plainly.** No em or en dashes, in either language: in
English use a period, colon, comma or parentheses, in Burmese `။` or `၊`.
Skip stock phrases ("the whole trick", "the submission worth writing", "a
licence to"); the caption of the approach to submit starts "The one to
submit." Plain sentences are fine as they are.

## Burmese

English-only is acceptable, because a missing Burmese side falls back to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ right.
draws itself (a board square) is at least 40px tall there too.
- ✓ Example cards: input, output, a `why` list explaining the answer, and a
"Load into the stepper" button.
- The traps disclosure, phrased as "N ways the statement bites".
- The traps disclosure, titled "N traps in the statement to know before you
code" (Burmese: "code မရေးမီ သိထားသင့်သည့် မေးခွန်းစာသားထဲက ချော်လွယ်သည့်နေရာ N ခု").

**2 · The answer, step by step** — three sub-sections, laid out by the kit:
- **2·1 Pick an approach.** ✓ A tab per mode (name, optional `sub`, one-line
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ problem's row on the home page to your page. `playHint` is the line under the
player in 2·2: the keys, what the reader can edit above it and within what
limits, and what rebuilds.

Traps are "ways the statement bites": each one names what the wrong code
returns, and you ran it to find out. Notes are questions a reader would ask
Traps are the places the statement trips people up: each one names what the
wrong code returns, and you ran it to find out. Notes are questions a reader would ask
("Why check for the partner *before* storing?"), answered in a paragraph.

### 6. Verify
Expand Down
2 changes: 1 addition & 1 deletion src/components/SiteFooter.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SITE_NAME, REPO } from '../data/site';
---
<footer class="site-foot">
<div class="shell">
<span>Written and verified by hand — every solution on this site was compiled and run before it was published.</span>
<span>Written and verified by hand. Every solution here was compiled and run before it went up.</span>
<span>The source is public on <a class="foot-link" href={REPO} target="_blank" rel="noopener">GitHub ↗</a>. Found a bug, a wrong answer or a confusing step? <a class="foot-link" href={`${REPO}/issues/new/choose`} target="_blank" rel="noopener">Report it there ↗</a></span>
<a class="sep" href="/">{SITE_NAME}</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Walkthrough.astro
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const lcUrl = (slug: string) => `https://leetcode.com/problems/${slug}/`;

<aside class="report" aria-labelledby="report-h">
<h3 id="report-h" data-i18n="အမှား တွေ့သလား။">Spot a mistake?</h3>
<p data-i18n="ဤ site ၏ source code သည် GitHub ပေါ်တွင် public ဖြစ်သည်။ bug၊ မှားသော အဖြေ၊ ရှုပ်ထွေးသော အဆင့် သို့မဟုတ် ဘာသာပြန် အမှားကို issue တစ်ခုအဖြစ် report လုပ်နိုင်သည် — ပြင်ဆင်ချက် pull request များကိုလည်း ကြိုဆိုသည်။">This site's source is public on GitHub. A bug, a wrong answer, a step that doesn't add up or a clumsy translation can be reported there as an issue — and pull requests with a fix are welcome too.</p>
<p data-i18n="ဤ site ၏ source code သည် GitHub ပေါ်တွင် public ဖြစ်သည်။ bug၊ မှားသော အဖြေ၊ ရှုပ်ထွေးသော အဆင့် သို့မဟုတ် ဘာသာပြန် အမှားကို issue တစ်ခုအဖြစ် report လုပ်နိုင်သည် — ပြင်ဆင်ချက် pull request များကိုလည်း ကြိုဆိုသည်။">The source is on GitHub. If you find a bug, a wrong answer, a step that doesn't add up or a clumsy translation, open an issue there. Pull requests are welcome too.</p>
<div class="report-links">
<a class="plink" href={issueUrl} target="_blank" rel="noopener" data-i18n="ဤစာမျက်နှာအတွက် issue report လုပ်ရန် ↗">Report an issue with this page ↗</a>
<a class="plink" href={`${REPO}/tree/main/src/lessons/${p.slug}`} target="_blank" rel="noopener" data-i18n="ဤစာမျက်နှာ၏ source ကို ကြည့်ရန် ↗">View this page's source ↗</a>
Expand Down
14 changes: 7 additions & 7 deletions src/lessons/3sum/lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,10 @@ const APPROACH = {
t('For every <code>i &lt; j &lt; k</code>, test whether the three sum to 0.',
'<code>i &lt; j &lt; k</code> တိုင်းအတွက် သုံးလုံးပေါင်း 0 ဖြစ်သလား စစ်သည်။'),
t('Put each one that does into <code>found</code>, a set; a triplet already there is dropped.',
'ဖြစ်သည့် တစ်ခုစီကို set ဖြစ်သော <code>found</code> ထဲ ထည့်သည် — ရှိပြီးသား triplet ကို ပယ်သည်။'),
'ဖြစ်သည့် တစ်ခုစီကို set ဖြစ်သော <code>found</code> ထဲ ထည့်သည်။ ရှိပြီးသား triplet ကို ပယ်သည်။'),
],
cost: t('n(n − 1)(n − 2)/6 triples: about 4.5 × 10⁹ at n = 3000.',
'triple n(n − 1)(n − 2)/6 ခု — n = 3000 တွင် 4.5 × 10⁹ ခန့်။'),
'triple n(n − 1)(n − 2)/6 ခု၊ n = 3000 တွင် 4.5 × 10⁹ ခန့်။'),
},
pointers: {
idea: t('Sort, then fix the smallest number of the triplet. The other two must sum to its negative, and in a sorted array two pointers find every such pair in one squeeze.',
Expand All @@ -569,7 +569,7 @@ const APPROACH = {
'သုည ဆိုလျှင် မှတ်ပြီး နှစ်ခုလုံး ရွှေ့ကာ <code>lo</code> ကို တူသော value များ ကျော်စေသည်။'),
],
cost: t('the sort, then one squeeze of at most n steps for each i: about 4.5 × 10⁶ pointer moves at n = 3000. No set: skipping equal values keeps the answer distinct.',
'sort၊ ပြီးမှ i တစ်ခုစီအတွက် အဆင့် n အထိ ညှပ်ခြင်း တစ်ကြိမ် — n = 3000 တွင် pointer ရွှေ့ခြင်း 4.5 × 10⁶ ခန့်။ set မလို — တူသော value များ ကျော်ခြင်းက အဖြေကို ကွဲပြားစေသည်။'),
'sort၊ ပြီးမှ i တစ်ခုစီအတွက် အဆင့် n အထိ ညှပ်ခြင်း တစ်ကြိမ်၊ n = 3000 တွင် pointer ရွှေ့ခြင်း 4.5 × 10⁶ ခန့်။ set မလိုပါ။ တူသော value များ ကျော်ခြင်းက အဖြေကို ကွဲပြားစေသည်။'),
},
};

Expand All @@ -591,14 +591,14 @@ mountLesson({
],
examples: [
{ title: exampleTitle(1), inputHtml: '<code>nums = [-1,0,1,2,-1,-4]</code>', output: '[[-1,-1,2],[-1,0,1]]',
why: [t('Three index triples sum to 0: (0,1,2), (1,2,4) and (0,3,4).', 'index triple သုံးခု ပေါင်းလျှင် 0 ရသည် — (0,1,2)၊ (1,2,4) နှင့် (0,3,4)။'),
why: [t('Three index triples sum to 0: (0,1,2), (1,2,4) and (0,3,4).', 'index triple သုံးခု ပေါင်းလျှင် 0 ရသည်: (0,1,2)၊ (1,2,4) နှင့် (0,3,4)။'),
t('(0,1,2) and (1,2,4) are both the triplet [-1,0,1], so it is listed once.', '(0,1,2) နှင့် (1,2,4) နှစ်ခုစလုံးသည် triplet [-1,0,1] ဖြစ်သဖြင့် တစ်ကြိမ်သာ ဖော်ပြသည်။')],
load: { nums: [-1, 0, 1, 2, -1, -4] } },
{ title: exampleTitle(2), inputHtml: '<code>nums = [0,1,1]</code>', output: '[]',
why: [t('The only triple is 0 + 1 + 1 = 2.', 'triple တစ်ခုတည်းမှာ 0 + 1 + 1 = 2။')],
load: { nums: [0, 1, 1] } },
{ title: exampleTitle(3), inputHtml: '<code>nums = [0,0,0]</code>', output: '[[0,0,0]]',
why: [t('The only triple sums to 0. The same value three times is fine — the positions differ.', 'triple တစ်ခုတည်း ပေါင်းလျှင် 0 ရသည်။ value တူ သုံးကြိမ် ဖြစ်လည်း ရသည် — နေရာ မတူပါ။')],
why: [t('The only triple sums to 0. The same value three times is fine, because the positions differ.', 'triple တစ်ခုတည်း ပေါင်းလျှင် 0 ရသည်။ value တူ သုံးကြိမ် ဖြစ်လည်း ရသည်၊ နေရာ မတူသောကြောင့်။')],
load: { nums: [0, 0, 0] } },
],
modes: [
Expand All @@ -616,8 +616,8 @@ mountLesson({
desc: t('Sort, try every triple, keep the zero-sum ones in a set. Correct, and cubic: too slow for n = 3000.',
'sort လုပ်၊ triple တိုင်း စမ်း၊ 0 ရသည်များကို set ထဲ ထည့်။ မှန်သည်၊ သို့သော် cubic ဖြစ်၍ n = 3000 အတွက် နှေးလွန်းသည်။') },
pointers: { approach: APPROACH.pointers,
desc: t('The submission worth writing. Sorted, each fixed number becomes a two-pointer squeeze, and skipping equal neighbours makes the answer distinct without a set.',
'ရေးသင့်သည့် submission။ sort ထားလျှင် ချုပ်ကိုင်ထားသော ကိန်းတစ်ခုစီသည် pointer နှစ်ခု ညှပ်ခြင်း ဖြစ်လာပြီး တူသော ကပ်လျက်ကိန်းများ ကျော်ခြင်းက set မပါဘဲ အဖြေကို ကွဲပြားစေသည်။') },
desc: t('The one to submit. Sorted, each fixed number becomes a two-pointer squeeze, and skipping equal neighbours makes the answer distinct without a set.',
'တင်သင့်သည့် ဗားရှင်း ဖြစ်သည်။ sort ထားလျှင် ချုပ်ကိုင်ထားသော ကိန်းတစ်ခုစီသည် pointer နှစ်ခု ညှပ်ခြင်း ဖြစ်လာပြီး တူသော ကပ်လျက်ကိန်းများ ကျော်ခြင်းက set မပါဘဲ အဖြေကို ကွဲပြားစေသည်။') },
},
// How each language was actually checked, printed as the part 3 badges.
// The corpus: the 3 examples, 5 edges, 15,000 random arrays of 3–9 values
Expand Down
Loading