Skip to content

chore/translate-new-notes - #19

Merged
Faustze merged 2 commits into
mainfrom
chore/translate-new-notes
Jul 24, 2026
Merged

chore/translate-new-notes#19
Faustze merged 2 commits into
mainfrom
chore/translate-new-notes

Conversation

@Faustze

@Faustze Faustze commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added Russian-language solutions and explanations for numerous LeetCode problems across arrays, math, stacks, trees, strings, and other topics.
    • Added new topic pages and problem entries, including Binary Search, 3Sum, Sudoku, Min Stack, and Maximum Depth of Binary Tree.
  • Documentation
    • Localized many problem statements, examples, explanations, and navigation pages into Russian.
    • Expanded and reorganized topic indexes for easier browsing.
  • Style
    • Standardized formatting, headings, code examples, and test snippets throughout the LeetCode documentation.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Faustze, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6905a071-1f40-4f7e-a831-76771fa4e950

📥 Commits

Reviewing files that changed from the base of the PR and between 67aa7f4 and 05c0f1d.

📒 Files selected for processing (65)
  • content-ru/.translation-manifest.json
  • content-ru/leetcode/Array/11-container-with-most-water.md
  • content-ru/leetcode/Array/128-longest-consecutive-sequence.md
  • content-ru/leetcode/Array/1365-how-many-numbers-are-smaller-than-the-current-number.md
  • content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md
  • content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md
  • content-ru/leetcode/Array/1470-shuffle-the-array.md
  • content-ru/leetcode/Array/1475-final-prices-with-a-special-discount-in-a-shop.md
  • content-ru/leetcode/Array/15-3sum.md
  • content-ru/leetcode/Array/150-evaluate-reverse-polish-notation.md
  • content-ru/leetcode/Array/217-contains-duplicate.md
  • content-ru/leetcode/Array/238-product-of-array-except-self.md
  • content-ru/leetcode/Array/268-missing-number.md
  • content-ru/leetcode/Array/283-move-zeroes.md
  • content-ru/leetcode/Array/347-top-k-frequent-elements.md
  • content-ru/leetcode/Array/36-valid-sudoku.md
  • content-ru/leetcode/Array/448-find-all-numbers-disappeared-in-an-array.md
  • content-ru/leetcode/Array/485-max-consecutive-ones.md
  • content-ru/leetcode/Array/49-group-anagrams.md
  • content-ru/leetcode/Array/496-next-greater-element-i.md
  • content-ru/leetcode/Array/605-can-place-flowers.md
  • content-ru/leetcode/Array/636-exclusive-time-of-functions.md
  • content-ru/leetcode/Array/643-maximum-average-subarray-i.md
  • content-ru/leetcode/Array/645-set-mismatch.md
  • content-ru/leetcode/Array/704-binary-search.md
  • content-ru/leetcode/Array/735-asteroid-collision.md
  • content-ru/leetcode/Array/739-daily-temperatures.md
  • content-ru/leetcode/Array/853-car-fleet.md
  • content-ru/leetcode/Array/977-squares-of-a-sorted-array.md
  • content-ru/leetcode/Hash Table/141-linked-list-cycle.md
  • content-ru/leetcode/Hash Table/242-valid-anagram.md
  • content-ru/leetcode/Linked List/206-reverse-linked-list.md
  • content-ru/leetcode/Linked List/876-middle-of-the-linked-list.md
  • content-ru/leetcode/Math/1071-greatest-common-divisor-of-strings.md
  • content-ru/leetcode/Math/67-add-binary.md
  • content-ru/leetcode/Stack/155-min-stack.md
  • content-ru/leetcode/String/20-valid-parentheses.md
  • content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md
  • content-ru/leetcode/Two Pointers/125-valid-palindrome.md
  • content-ru/leetcode/Two Pointers/151-reverse-words-in-a-string.md
  • content-ru/leetcode/Two Pointers/1768-merge-strings-alternately.md
  • content-ru/leetcode/Two Pointers/345-reverse-vowels-of-a-string.md
  • content-ru/leetcode/Two Pointers/392-is-subsequence.md
  • content-ru/leetcode/Two Pointers/844-backspace-string-compare.md
  • content-ru/leetcode/Untagged/125-valid-palindrome-neetcode.md
  • content-ru/leetcode/Untagged/2620-counter.md
  • content-ru/leetcode/Untagged/2622-cache-with-time-limit.md
  • content-ru/leetcode/Untagged/2623-memoize.md
  • content-ru/leetcode/Untagged/2626-array-reduce-transformation.md
  • content-ru/leetcode/Untagged/2627-debounce.md
  • content-ru/leetcode/Untagged/2629-function-composition.md
  • content-ru/leetcode/Untagged/2631-group-by.md
  • content-ru/leetcode/Untagged/2637-promise-time-limit.md
  • content-ru/leetcode/Untagged/2665-counter2.md
  • content-ru/leetcode/Untagged/2666-allow-one-fn-call.md
  • content-ru/leetcode/Untagged/2677-chunk-array.md
  • content-ru/leetcode/Untagged/2693-call-function-with-custom-context.md
  • content-ru/leetcode/Untagged/2703-return-length-of-arguments-passed.md
  • content-ru/leetcode/Untagged/271-string-encode-and-decode.md
  • content-ru/leetcode/Untagged/2715-timeout-cancellation.md
  • content-ru/leetcode/Untagged/2721-execute-asynchronous-functions-in-parallel.md
  • content-ru/leetcode/Untagged/2723-add-two-promises.md
  • content-ru/leetcode/Untagged/2724-sort-by.md
  • content-ru/leetcode/Untagged/2725-interval-cancellation.md
  • content-ru/leetcode/Untagged/2726-calculator-with-method-chaining.md
📝 Walkthrough

Walkthrough

The pull request expands and localizes the Russian LeetCode collection. It adds new problem pages, updates existing explanations and examples, adds section indexes, changes navigation paths and labels, and refreshes translation manifest hashes.

Changes

Russian LeetCode content

Layer / File(s) Summary
Array problem pages and index
content-ru/leetcode/Array/*
Adds multiple Array solutions and local checks, translates existing statements and examples, and expands the Array problem index.
Supporting LeetCode sections
content-ru/leetcode/Hash Table/*, content-ru/leetcode/Linked List/*, content-ru/leetcode/Math/*, content-ru/leetcode/Stack/*, content-ru/leetcode/String/*, content-ru/leetcode/Tree/*, content-ru/leetcode/Two Pointers/*
Adds Math, Stack, String, and Tree content; localizes related pages and indexes; and updates category link paths and titles.
Untagged problem pages
content-ru/leetcode/Untagged/*
Adds and localizes JavaScript/TypeScript problem write-ups, including encoding, asynchronous, cancellation, and function utility examples.
Translation manifest
content-ru/.translation-manifest.json
Refreshes hashes for changed LeetCode entries and includes newly added Array entries.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is just the default template and contains no actual summary of the pull request changes. Replace the template text with a real change summary and include the required closing LLM note if applicable.
Title check ❓ Inconclusive The title is related to the work, but it's generic and doesn't clearly convey the main change. Use a clearer conventional-commit title that names the primary change, e.g. the Russian LeetCode note translations and new pages.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/translate-new-notes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

CI's `npm run check` (prettier --check) was failing on PR #19 for 64
new Russian-language leetcode notes. Reformatted with prettier --write.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
content-ru/leetcode/Untagged/2631-group-by.md (1)

20-29: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle prototype keys safely in groupBy.

fn may return any string, but key in result also matches inherited properties. Inputs producing keys such as constructor, toString, or __proto__ can throw or behave incorrectly.

Suggested fix
-  const result: Record<string, T[]> = {}
+  const result = Object.create(null) as Record<string, T[]>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Untagged/2631-group-by.md` around lines 20 - 29, Update
the grouping logic in groupBy so keys returned by fn are checked only against
result’s own properties, preventing inherited prototype keys such as
constructor, toString, and __proto__ from being treated as existing groups.
Preserve the current append-or-create behavior for all keys.
content-ru/leetcode/Two Pointers/125-valid-palindrome.md (1)

54-54: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Normalize the Two Pointers navigation paths.

The changed links use Two-Pointers, but the supplied directory is named Two Pointers, so these related-page links may not resolve.

  • content-ru/leetcode/Two Pointers/125-valid-palindrome.md#L54-L54: change leetcode/Two-Pointers/151-reverse-words-in-a-string to leetcode/Two Pointers/151-reverse-words-in-a-string.
  • content-ru/leetcode/Two Pointers/151-reverse-words-in-a-string.md#L45-L46: change both Two-Pointers targets to Two Pointers.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Two` Pointers/125-valid-palindrome.md at line 54,
Normalize the related-page navigation paths by replacing the Two-Pointers
directory segment with Two Pointers in content-ru/leetcode/Two
Pointers/125-valid-palindrome.md lines 54-54 and both targets in
content-ru/leetcode/Two Pointers/151-reverse-words-in-a-string.md lines 45-46.
🟡 Minor comments (15)
content-ru/leetcode/Array/11-container-with-most-water.md-10-35 (1)

10-35: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Resolve the Prettier failures before merging.

  • content-ru/leetcode/Array/11-container-with-most-water.md#L10-L35: run Prettier on the Markdown and fenced TypeScript.
  • content-ru/leetcode/Array/128-longest-consecutive-sequence.md#L7-L49: run Prettier on the Markdown and fenced TypeScript.
  • content-ru/leetcode/Array/15-3sum.md#L8-L56: run Prettier on the Markdown and fenced TypeScript.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/11-container-with-most-water.md` around lines 10 -
35, Resolve the Prettier formatting failures in
content-ru/leetcode/Array/11-container-with-most-water.md lines 10-35,
content-ru/leetcode/Array/128-longest-consecutive-sequence.md lines 7-49, and
content-ru/leetcode/Array/15-3sum.md lines 8-56 by running Prettier over each
Markdown file and its fenced TypeScript blocks; preserve the existing examples
and behavior.

Source: Pipeline failures

content-ru/leetcode/Array/11-container-with-most-water.md-8-8 (1)

8-8: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Split the concatenated constraint lists into separate items.

  • content-ru/leetcode/Array/11-container-with-most-water.md#L8-L8: restore n == height.length, 2 <= n <= 10^5, and 0 <= height[i] <= 10^4.
  • content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md#L7-L7: separate the n, candies[i], and extraCandies bounds.
  • content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md#L13-L13: separate each target and stream constraint.
  • content-ru/leetcode/Array/1470-shuffle-the-array.md#L5-L5: separate the n, array-length, and value bounds.
  • content-ru/leetcode/Array/15-3sum.md#L6-L6: separate the array-length and value bounds.
  • content-ru/leetcode/Array/217-contains-duplicate.md#L4-L4: separate the array-length and value bounds.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/11-container-with-most-water.md` at line 8,
Separate the concatenated constraint lists into distinct Markdown list items.
Update content-ru/leetcode/Array/11-container-with-most-water.md lines 8-8 to
restore n == height.length, 2 <= n <= 10^5, and 0 <= height[i] <= 10^4; apply
the same separation to the n, candies[i], and extraCandies bounds in
content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md lines
7-7, each target and stream constraint in
content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md lines
13-13, the n, array-length, and value bounds in
content-ru/leetcode/Array/1470-shuffle-the-array.md lines 5-5, and the
array-length and value bounds in content-ru/leetcode/Array/15-3sum.md lines 6-6
and content-ru/leetcode/Array/217-contains-duplicate.md lines 4-4.
content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md-53-53 (1)

53-53: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Keep navigation metadata outside fenced examples and use the canonical leetcode path casing.

  • Move the affected <!-- [[leetcode/array]] ... --> comments into the surrounding non-fenced content of both files and change leetcode/array to leetcode/Array.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md`
at line 53, In
content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md at
line 53 and
content-ru/leetcode/Array/1475-final-prices-with-a-special-discount-in-a-shop.md
at line 50, move the navigation metadata comments outside fenced code examples
into surrounding non-fenced content, and change every leetcode/array reference
to leetcode/Array.
content-ru/leetcode/Array/36-valid-sudoku.md-12-12 (1)

12-12: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Format board[i][j] as code.

Markdown interprets the bracket notation as a reference-style link and reports an undefined j reference. Wrap the expression in backticks (and similarly format the constraint expressions) to preserve the intended text.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/36-valid-sudoku.md` at line 12, Format the
constraint expressions in the “Ограничения” line as inline code, especially
board[i][j], so Markdown does not interpret the bracket notation as a link
reference; apply the same formatting consistently to board.length,
board[i].length, and the value expression.

Source: Linters/SAST tools

content-ru/leetcode/Array/283-move-zeroes.md-26-30 (1)

26-30: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Log the mutated arrays in the local checks.

moveZeroes returns void, so console.log(moveZeroes(...)) prints undefined instead of the transformed array.

Proposed fix
-console.log(moveZeroes([0, 1, 0, 3, 12]));
-console.log(moveZeroes([0]));
-console.log(moveZeroes([0, 1, 2, 3, 0]));
+const nums1 = [0, 1, 0, 3, 12];
+moveZeroes(nums1);
+console.log(nums1);
+
+const nums2 = [0];
+moveZeroes(nums2);
+console.log(nums2);
+
+const nums3 = [0, 1, 2, 3, 0];
+moveZeroes(nums3);
+console.log(nums3);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/283-move-zeroes.md` around lines 26 - 30, Update
the local checks for moveZeroes to log each input array after the function
mutates it, rather than logging the void return value. Preserve the existing
test cases and ensure the transformed arrays are the values passed to
console.log.
content-ru/leetcode/Linked List/206-reverse-linked-list.md-44-44 (1)

44-44: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the local-check output comment.

reverseList(null) returns null, not []; update the comment to // null or change the check to serialize the result as an empty list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Linked` List/206-reverse-linked-list.md at line 44,
Update the local-check annotation for reverseList(null) to reflect the
function’s actual null return value by changing the comment to // null; do not
alter reverseList behavior.
content-ru/leetcode/Linked List/206-reverse-linked-list.md-3-7 (1)

3-7: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep this page localized in Russian.

This content-ru page replaces its problem statement and examples with English text, which regresses the Russian localization delivered by this PR. Translate the changed prose consistently with the surrounding Russian pages.

Also applies to: 47-61

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Linked` List/206-reverse-linked-list.md around lines 3 -
7, Translate the changed problem statement, constraints, follow-up, and examples
in the localized Linked List page back into Russian, matching the terminology
and style of surrounding Russian pages while preserving the problem’s meaning
and structure.
content-ru/leetcode/Array/496-next-greater-element-i.md-60-60 (1)

60-60: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the repeated Markdown heading syntax.

Each #leetcode footer should be changed to # leetcode to satisfy markdownlint MD018.

  • content-ru/leetcode/Array/496-next-greater-element-i.md#L60-L60: add the missing space after #.
  • content-ru/leetcode/Array/704-binary-search.md#L49-L49: add the missing space after #.
  • content-ru/leetcode/Array/735-asteroid-collision.md#L86-L86: add the missing space after #.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/496-next-greater-element-i.md` at line 60, Update
the repeated Markdown footer heading from “#leetcode” to “# leetcode” in
content-ru/leetcode/Array/496-next-greater-element-i.md:60-60,
content-ru/leetcode/Array/704-binary-search.md:49-49, and
content-ru/leetcode/Array/735-asteroid-collision.md:86-86.

Source: Linters/SAST tools

content-ru/leetcode/index.md-10-15 (1)

10-15: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Сохраните доступность категории Bit Manipulation.

Этот индекс удаляет категорию Bit Manipulation, но content-ru/leetcode/Math/67-add-binary.md по-прежнему ссылается на leetcode/Bit Manipulation/index. Оставьте категорию в корневом списке либо обновите ссылку на существующий индекс.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/index.md` around lines 10 - 15, Restore the Bit
Manipulation category in the root leetcode index, or update the reference in
Math/67-add-binary.md to point to an existing index; preserve a valid navigable
link for that category.
content-ru/leetcode/Array/853-car-fleet.md-4-4 (1)

4-4: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Исправьте согласование в описании массивов.

position и speed — два массива, поэтому здесь должно быть обе длиной n, а не оба длиной n.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/853-car-fleet.md` at line 4, В описании задачи
исправьте согласование для массивов position и speed: замените «оба длиной n» на
«обе длиной n», не изменяя остальной текст.

Source: Linters/SAST tools

content-ru/leetcode/Untagged/2726-calculator-with-method-chaining.md-15-15 (1)

15-15: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Разделите ограничения на отдельные пункты.

Сейчас строка смешивает арифметические * и разделители -, из-за чего ограничения плохо читаются и срабатывает markdownlint MD037. Используйте отдельные blockquote-строки и × либо code spans для умножения.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Untagged/2726-calculator-with-method-chaining.md` at line
15, Разделите ограничения в описании задачи на отдельные строки blockquote:
каждое условие должно быть самостоятельным пунктом. Замените арифметические
символы `*` на `×` или оформите их через code spans, сохранив все исходные
условия и значения.

Source: Linters/SAST tools

content-ru/leetcode/Stack/155-min-stack.md-13-50 (1)

13-50: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the failing Prettier check before merge.

The pipeline reports that Prettier fails for this file. Run Prettier on the Markdown file and commit the formatted result.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Stack/155-min-stack.md` around lines 13 - 50, Run
Prettier on the Markdown file containing the MinStack example and apply its
formatting to the code block and surrounding content. Preserve the
implementation and examples unchanged apart from formatting, then commit the
resulting formatted file.

Source: Pipeline failures

content-ru/leetcode/String/20-valid-parentheses.md-12-23 (1)

12-23: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the failing Prettier check before merge.

The pipeline reports that Prettier fails for this file. Run Prettier on the Markdown file and commit the formatted result.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/String/20-valid-parentheses.md` around lines 12 - 23, Run
Prettier against the Markdown file containing isValid and the local console.log
checks, then commit the formatter’s output without changing the example’s
behavior.

Source: Pipeline failures

content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md-52-52 (1)

52-52: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the Tree index link.

This page links to leetcode/Binary-Tree/index, but the corresponding Russian index is leetcode/Tree/index. The current link will not navigate to the supplied category page.

Proposed fix
-[[leetcode/Binary-Tree/index]]
+[[leetcode/Tree/index]]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md` at line 52,
Update the index link in the maximum-depth-of-binary-tree page from
leetcode/Binary-Tree/index to the correct Russian category path
leetcode/Tree/index.
content-ru/leetcode/Two Pointers/index.md-9-14 (1)

9-14: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update remaining backlinks after the path migration.

The index now uses Two Pointers/..., but content-ru/leetcode/Two Pointers/345-reverse-vowels-of-a-string.md still links to Two-Pointers/1768-merge-strings-alternately, which no longer matches the renamed directory. Search and update remaining Two-Pointers/ references consistently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Two` Pointers/index.md around lines 9 - 14, Search the
content-ru/leetcode/Two Pointers subtree for remaining `Two-Pointers/` backlinks
and update them to the renamed `Two Pointers/` path, including the link in
`345-reverse-vowels-of-a-string.md`; preserve each existing target and link
formatting.
🧹 Nitpick comments (1)
content-ru/leetcode/Untagged/2703-return-length-of-arguments-passed.md (1)

10-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Simplify the unreachable fallback.

Because args is always an array when created by a rest parameter, Array.isArray(args) is always true. Returning args.length directly makes the implementation clearer.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Untagged/2703-return-length-of-arguments-passed.md`
around lines 10 - 15, In argumentsLength, remove the redundant
Array.isArray(args) condition and unreachable fallback, returning args.length
directly for the rest-parameter array.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content-ru/leetcode/Array/128-longest-consecutive-sequence.md`:
- Around line 12-16: Update the loop in the longest-consecutive-sequence
solution to iterate over unique values rather than every entry in nums, while
retaining the predecessor check and sequence scan. Use the existing set st to
skip duplicate values before processing, ensuring repeated smallest values
cannot trigger repeated full scans and the algorithm remains O(n).

In `@content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md`:
- Around line 8-10: Update the stack-operation rules in the problem statement so
the Pop operation occurs only when the streamed integer is not contained in
target, rather than whenever the stack is non-empty. Preserve the existing Push
rule and the stopping condition once the stack matches target.

In `@content-ru/leetcode/Stack/155-min-stack.md`:
- Around line 32-38: Update top() and getMin() to apply the existing non-null
assertion pattern to stack.at(-1) and minStack.at(-1), respectively, so both
methods satisfy their declared number return types while preserving the current
access behavior.

In `@content-ru/leetcode/String/20-valid-parentheses.md`:
- Around line 13-15: Implement the empty isValid function to evaluate whether
the input string contains properly matched and nested parentheses, brackets, and
braces, returning a boolean for every input. Use a stack-based approach that
matches each closing delimiter with its corresponding opener and rejects
mismatches or leftover openers.

In `@content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md`:
- Around line 1-53: Run the repository’s Prettier formatter on the markdown file
containing the TreeNode class and maxDepth function, then apply and commit only
the formatter-generated changes so the Prettier check passes.

In `@content-ru/leetcode/Untagged/2693-call-function-with-custom-context.md`:
- Around line 20-25: Update the wrapper logic around the context object to use
the supplied context directly instead of creating a spread copy, preserving its
identity, prototype chain, and non-enumerable properties. Assign the temporary
symbol property to that original context, invoke the function through it, and
remove the temporary property afterward while preserving the existing argument
forwarding behavior.

---

Outside diff comments:
In `@content-ru/leetcode/Two` Pointers/125-valid-palindrome.md:
- Line 54: Normalize the related-page navigation paths by replacing the
Two-Pointers directory segment with Two Pointers in content-ru/leetcode/Two
Pointers/125-valid-palindrome.md lines 54-54 and both targets in
content-ru/leetcode/Two Pointers/151-reverse-words-in-a-string.md lines 45-46.

In `@content-ru/leetcode/Untagged/2631-group-by.md`:
- Around line 20-29: Update the grouping logic in groupBy so keys returned by fn
are checked only against result’s own properties, preventing inherited prototype
keys such as constructor, toString, and __proto__ from being treated as existing
groups. Preserve the current append-or-create behavior for all keys.

---

Minor comments:
In `@content-ru/leetcode/Array/11-container-with-most-water.md`:
- Around line 10-35: Resolve the Prettier formatting failures in
content-ru/leetcode/Array/11-container-with-most-water.md lines 10-35,
content-ru/leetcode/Array/128-longest-consecutive-sequence.md lines 7-49, and
content-ru/leetcode/Array/15-3sum.md lines 8-56 by running Prettier over each
Markdown file and its fenced TypeScript blocks; preserve the existing examples
and behavior.
- Line 8: Separate the concatenated constraint lists into distinct Markdown list
items. Update content-ru/leetcode/Array/11-container-with-most-water.md lines
8-8 to restore n == height.length, 2 <= n <= 10^5, and 0 <= height[i] <= 10^4;
apply the same separation to the n, candies[i], and extraCandies bounds in
content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md lines
7-7, each target and stream constraint in
content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md lines
13-13, the n, array-length, and value bounds in
content-ru/leetcode/Array/1470-shuffle-the-array.md lines 5-5, and the
array-length and value bounds in content-ru/leetcode/Array/15-3sum.md lines 6-6
and content-ru/leetcode/Array/217-contains-duplicate.md lines 4-4.

In `@content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md`:
- Line 53: In
content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md at
line 53 and
content-ru/leetcode/Array/1475-final-prices-with-a-special-discount-in-a-shop.md
at line 50, move the navigation metadata comments outside fenced code examples
into surrounding non-fenced content, and change every leetcode/array reference
to leetcode/Array.

In `@content-ru/leetcode/Array/283-move-zeroes.md`:
- Around line 26-30: Update the local checks for moveZeroes to log each input
array after the function mutates it, rather than logging the void return value.
Preserve the existing test cases and ensure the transformed arrays are the
values passed to console.log.

In `@content-ru/leetcode/Array/36-valid-sudoku.md`:
- Line 12: Format the constraint expressions in the “Ограничения” line as inline
code, especially board[i][j], so Markdown does not interpret the bracket
notation as a link reference; apply the same formatting consistently to
board.length, board[i].length, and the value expression.

In `@content-ru/leetcode/Array/496-next-greater-element-i.md`:
- Line 60: Update the repeated Markdown footer heading from “#leetcode” to “#
leetcode” in content-ru/leetcode/Array/496-next-greater-element-i.md:60-60,
content-ru/leetcode/Array/704-binary-search.md:49-49, and
content-ru/leetcode/Array/735-asteroid-collision.md:86-86.

In `@content-ru/leetcode/Array/853-car-fleet.md`:
- Line 4: В описании задачи исправьте согласование для массивов position и
speed: замените «оба длиной n» на «обе длиной n», не изменяя остальной текст.

In `@content-ru/leetcode/index.md`:
- Around line 10-15: Restore the Bit Manipulation category in the root leetcode
index, or update the reference in Math/67-add-binary.md to point to an existing
index; preserve a valid navigable link for that category.

In `@content-ru/leetcode/Linked` List/206-reverse-linked-list.md:
- Line 44: Update the local-check annotation for reverseList(null) to reflect
the function’s actual null return value by changing the comment to // null; do
not alter reverseList behavior.
- Around line 3-7: Translate the changed problem statement, constraints,
follow-up, and examples in the localized Linked List page back into Russian,
matching the terminology and style of surrounding Russian pages while preserving
the problem’s meaning and structure.

In `@content-ru/leetcode/Stack/155-min-stack.md`:
- Around line 13-50: Run Prettier on the Markdown file containing the MinStack
example and apply its formatting to the code block and surrounding content.
Preserve the implementation and examples unchanged apart from formatting, then
commit the resulting formatted file.

In `@content-ru/leetcode/String/20-valid-parentheses.md`:
- Around line 12-23: Run Prettier against the Markdown file containing isValid
and the local console.log checks, then commit the formatter’s output without
changing the example’s behavior.

In `@content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md`:
- Line 52: Update the index link in the maximum-depth-of-binary-tree page from
leetcode/Binary-Tree/index to the correct Russian category path
leetcode/Tree/index.

In `@content-ru/leetcode/Two` Pointers/index.md:
- Around line 9-14: Search the content-ru/leetcode/Two Pointers subtree for
remaining `Two-Pointers/` backlinks and update them to the renamed `Two
Pointers/` path, including the link in `345-reverse-vowels-of-a-string.md`;
preserve each existing target and link formatting.

In `@content-ru/leetcode/Untagged/2726-calculator-with-method-chaining.md`:
- Line 15: Разделите ограничения в описании задачи на отдельные строки
blockquote: каждое условие должно быть самостоятельным пунктом. Замените
арифметические символы `*` на `×` или оформите их через code spans, сохранив все
исходные условия и значения.

---

Nitpick comments:
In `@content-ru/leetcode/Untagged/2703-return-length-of-arguments-passed.md`:
- Around line 10-15: In argumentsLength, remove the redundant
Array.isArray(args) condition and unreachable fallback, returning args.length
directly for the rest-parameter array.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ad8171eb-9c24-4b31-9112-120e1d657dbd

📥 Commits

Reviewing files that changed from the base of the PR and between be4aa8c and 67aa7f4.

📒 Files selected for processing (75)
  • content-ru/.translation-manifest.json
  • content-ru/leetcode/Array/11-container-with-most-water.md
  • content-ru/leetcode/Array/128-longest-consecutive-sequence.md
  • content-ru/leetcode/Array/1365-how-many-numbers-are-smaller-than-the-current-number.md
  • content-ru/leetcode/Array/1431-kids-with-the-greatest-number-of-candies.md
  • content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md
  • content-ru/leetcode/Array/1470-shuffle-the-array.md
  • content-ru/leetcode/Array/1475-final-prices-with-a-special-discount-in-a-shop.md
  • content-ru/leetcode/Array/15-3sum.md
  • content-ru/leetcode/Array/150-evaluate-reverse-polish-notation.md
  • content-ru/leetcode/Array/217-contains-duplicate.md
  • content-ru/leetcode/Array/238-product-of-array-except-self.md
  • content-ru/leetcode/Array/268-missing-number.md
  • content-ru/leetcode/Array/283-move-zeroes.md
  • content-ru/leetcode/Array/347-top-k-frequent-elements.md
  • content-ru/leetcode/Array/36-valid-sudoku.md
  • content-ru/leetcode/Array/448-find-all-numbers-disappeared-in-an-array.md
  • content-ru/leetcode/Array/485-max-consecutive-ones.md
  • content-ru/leetcode/Array/49-group-anagrams.md
  • content-ru/leetcode/Array/496-next-greater-element-i.md
  • content-ru/leetcode/Array/605-can-place-flowers.md
  • content-ru/leetcode/Array/636-exclusive-time-of-functions.md
  • content-ru/leetcode/Array/643-maximum-average-subarray-i.md
  • content-ru/leetcode/Array/645-set-mismatch.md
  • content-ru/leetcode/Array/704-binary-search.md
  • content-ru/leetcode/Array/735-asteroid-collision.md
  • content-ru/leetcode/Array/739-daily-temperatures.md
  • content-ru/leetcode/Array/853-car-fleet.md
  • content-ru/leetcode/Array/977-squares-of-a-sorted-array.md
  • content-ru/leetcode/Array/index.md
  • content-ru/leetcode/Hash Table/141-linked-list-cycle.md
  • content-ru/leetcode/Hash Table/242-valid-anagram.md
  • content-ru/leetcode/Hash Table/index.md
  • content-ru/leetcode/Linked List/206-reverse-linked-list.md
  • content-ru/leetcode/Linked List/876-middle-of-the-linked-list.md
  • content-ru/leetcode/Linked List/index.md
  • content-ru/leetcode/Math/1071-greatest-common-divisor-of-strings.md
  • content-ru/leetcode/Math/67-add-binary.md
  • content-ru/leetcode/Math/index.md
  • content-ru/leetcode/Stack/155-min-stack.md
  • content-ru/leetcode/Stack/index.md
  • content-ru/leetcode/String/20-valid-parentheses.md
  • content-ru/leetcode/String/index.md
  • content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md
  • content-ru/leetcode/Tree/index.md
  • content-ru/leetcode/Two Pointers/125-valid-palindrome.md
  • content-ru/leetcode/Two Pointers/151-reverse-words-in-a-string.md
  • content-ru/leetcode/Two Pointers/1768-merge-strings-alternately.md
  • content-ru/leetcode/Two Pointers/345-reverse-vowels-of-a-string.md
  • content-ru/leetcode/Two Pointers/392-is-subsequence.md
  • content-ru/leetcode/Two Pointers/844-backspace-string-compare.md
  • content-ru/leetcode/Two Pointers/index.md
  • content-ru/leetcode/Untagged/125-valid-palindrome-neetcode.md
  • content-ru/leetcode/Untagged/2620-counter.md
  • content-ru/leetcode/Untagged/2622-cache-with-time-limit.md
  • content-ru/leetcode/Untagged/2623-memoize.md
  • content-ru/leetcode/Untagged/2626-array-reduce-transformation.md
  • content-ru/leetcode/Untagged/2627-debounce.md
  • content-ru/leetcode/Untagged/2629-function-composition.md
  • content-ru/leetcode/Untagged/2631-group-by.md
  • content-ru/leetcode/Untagged/2637-promise-time-limit.md
  • content-ru/leetcode/Untagged/2665-counter2.md
  • content-ru/leetcode/Untagged/2666-allow-one-fn-call.md
  • content-ru/leetcode/Untagged/2677-chunk-array.md
  • content-ru/leetcode/Untagged/2693-call-function-with-custom-context.md
  • content-ru/leetcode/Untagged/2703-return-length-of-arguments-passed.md
  • content-ru/leetcode/Untagged/271-string-encode-and-decode.md
  • content-ru/leetcode/Untagged/2715-timeout-cancellation.md
  • content-ru/leetcode/Untagged/2721-execute-asynchronous-functions-in-parallel.md
  • content-ru/leetcode/Untagged/2723-add-two-promises.md
  • content-ru/leetcode/Untagged/2724-sort-by.md
  • content-ru/leetcode/Untagged/2725-interval-cancellation.md
  • content-ru/leetcode/Untagged/2726-calculator-with-method-chaining.md
  • content-ru/leetcode/Untagged/index.md
  • content-ru/leetcode/index.md

Comment on lines +12 to +16
for (let i = 0; i < nums.length; i++) {
if (st.has(nums[i] - 1)) continue
for (let j = 1; j < nums.length + 1; j++) {
// является ли число началом последовательности?
if (st.has(nums[i] + j)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Iterate over unique values to preserve O(n).

Duplicate copies of the smallest value pass the predecessor check and each rescan the entire sequence. For example, many 1s followed by 2..50001 can make this quadratic and violate the problem’s required complexity.

Proposed fix
-  for (let i = 0; i < nums.length; i++) {
-    if (st.has(nums[i] - 1)) continue
+  for (const num of st) {
+    if (st.has(num - 1)) continue
     for (let j = 1; j < nums.length + 1; j++) {
-      if (st.has(nums[i] + j)) {
+      if (st.has(num + j)) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (let i = 0; i < nums.length; i++) {
if (st.has(nums[i] - 1)) continue
for (let j = 1; j < nums.length + 1; j++) {
// является ли число началом последовательности?
if (st.has(nums[i] + j)) {
for (const num of st) {
if (st.has(num - 1)) continue
for (let j = 1; j < nums.length + 1; j++) {
// является ли число началом последовательности?
if (st.has(num + j)) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Array/128-longest-consecutive-sequence.md` around lines
12 - 16, Update the loop in the longest-consecutive-sequence solution to iterate
over unique values rather than every entry in nums, while retaining the
predecessor check and sequence scan. Use the existing set st to skip duplicate
values before processing, ensuring repeated smallest values cannot trigger
repeated full scans and the algorithm remains O(n).

Comment thread content-ru/leetcode/Array/1441-build-an-array-with-stack-operations.md Outdated
Comment on lines +32 to +38
top(): number {
return this.stack.at(-1);
}

getMin(): number {
return this.minStack.at(-1);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Repository files matching target:"
fd -a '155-min-stack\.md$' . || true

echo
echo "Target excerpt:"
file=$(fd '155-min-stack\.md$' . | head -n 1 || true)
if [ -n "${file:-}" ]; then
  wc -l "$file"
  sed -n '1,80p' "$file" | nl -ba
fi

echo
echo "Search for tsconfig/strict null checks hints:"
fd -a 'tsconfig.*\.json$|package.json$' . | head -n 50 | while read -r f; do
  echo "--- $f"
  sed -n '1,160p' "$f" | grep -nE '(strictNullChecks|strict|typeAcquisition|compilerOptions|typescript)' || true
done

echo
echo "Search same Stack solution patterns:"
rg -n "top\(\)[^}]*at\(-1\)|getMin\(\)[^}]*at\(-1\)" . || true

echo
echo "Read-only JS/TS type probe using declared lib semantics if available:"
node - <<'JS'
function f() {
  // Mirrors TypeScript lib.dom.d.ts / lib.es2022.array.d.ts signature for Array.prototype.at
  // (TS5+): at(index: number): T | undefined.
  // In runtime JS, at(-1) on non-empty array returns value; nullability is a type-system concern.
  console.log('runtime example:', [1,2].at(-1), [1,2].at(0));
}
f();
JS

Repository: Faustze/notes

Length of output: 409


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="./content-ru/leetcode/Stack/155-min-stack.md"
echo "Line count:"
wc -l "$file"

echo
echo "Target excerpt with line numbers:"
awk '{printf "%4d %s\n", NR, $0}' "$file" | sed -n '1,90p'

echo
echo "Candidate repo files:"
printf '%s\n' ./content-ru/leetcode/Stack/155-min-stack.md ./content/leetcode/Stack/155-min-stack.md

echo
echo "Search for tsconfig/package.json and relevant compiler options:"
fd -a 'tsconfig.*\.json$|package.json$' . 2>/dev/null | while read -r f; do
  echo "--- $f"
  grep -nE '(strictNullChecks|strict|typeAcquisition|compilerOptions|typescript|noEmit|ts-node)' "$f" || true
done

echo
echo "Search same top/getMin stack.at(-1) pattern:"
rg -n "top\(\)[^}]*at\(-1\)|getMin\(\)[^}]*at\(-1\)" . || true

echo
echo "Type check probe with local TypeScript if available:"
if command -v tsc >/dev/null 2>&1; then
  tmpdir=$(mktemp -d)
  cat > "$tmpdir/probe.ts" <<'TS'
class MinStack {
  private stack: number[] = [];
  private minStack: number[] = [];

  top(): number {
    return this.stack.at(-1);
  }

  getMin(): number {
    return this.minStack.at(-1);
  }
}
TS
  tsc --noEmit --strictNullChecks "$tmpdir/probe.ts" || true
else
  echo "tsc not available"
fi

Repository: Faustze/notes

Length of output: 2915


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "tsconfig.json:"
cat -n tsconfig.json

echo
echo "Type check probe with local TypeScript, ignoring repo tsconfig:"
tmpdir=$(mktemp -d)
cat > "$tmpdir/probe.ts" <<'TS'
class MinStack {
  private stack: number[] = [];
  private minStack: number[] = [];

  top(): number {
    return this.stack.at(-1);
  }

  getMin(): number {
    return this.minStack.at(-1);
  }
}
TS
tsc --ignoreConfig --noEmit --strict "$tmpdir/probe.ts"

Repository: Faustze/notes

Length of output: 1912


Coerce at(-1) before returning from typed methods.

stack.at(-1) and minStack.at(-1) return number | undefined, so top() and getMin() violate their declared number return types under strict null checks. Use the non-null assertion already used elsewhere for guaranteed non-empty stack access.

Suggested fix
   top(): number {
-    return this.stack.at(-1);
+    return this.stack.at(-1)!;
   }

   getMin(): number {
-    return this.minStack.at(-1);
+    return this.minStack.at(-1)!;
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
top(): number {
return this.stack.at(-1);
}
getMin(): number {
return this.minStack.at(-1);
}
top(): number {
return this.stack.at(-1)!;
}
getMin(): number {
return this.minStack.at(-1)!;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Stack/155-min-stack.md` around lines 32 - 38, Update
top() and getMin() to apply the existing non-null assertion pattern to
stack.at(-1) and minStack.at(-1), respectively, so both methods satisfy their
declared number return types while preserving the current access behavior.

Comment on lines +13 to +15
function isValid(s: string): boolean {

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Implement isValid before publishing this solution.

The function body is empty, so every example returns undefined instead of the documented boolean result.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/String/20-valid-parentheses.md` around lines 13 - 15,
Implement the empty isValid function to evaluate whether the input string
contains properly matched and nested parentheses, brackets, and braces,
returning a boolean for every input. Use a stack-based approach that matches
each closing delimiter with its corresponding opener and rejects mismatches or
leftover openers.

Comment thread content-ru/leetcode/Tree/104-maximum-depth-of-binary-tree.md
Comment on lines +20 to +25
let object = { ...context } as any
let symbol = Symbol('context')
// this здесь — это функция
object[symbol] = this
// Вызываем add как метод object
return object[symbol](...args)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the target file and nearby test/solution context without running repo code.
target="content-ru/leetcode/Untagged/2693-call-function-with-custom-context.md"
if [ -f "$target" ]; then
  echo "== target exists =="
  wc -l "$target"
  echo "== target lines 1-80 =="
  sed -n '1,80p' "$target" | cat -n
else
  echo "target not found"
  fd -i '2693-call-function-with-custom-context|CustomContext|callPolyfill' .
fi

echo "== occurrences of callPolyfill / context spread in repo =="
rg -n "function.*callPolyfill|method: context|callPolyfill|{ ...context }|Object\.assign|Function\.prototype\.call" . || true

Repository: Faustze/notes

Length of output: 3116


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== JS spread identity/prototype behavior =="
node - <<'JS'
const proto = { inherited: 1, nonEnumerable: 2 };
proto.nonEnumerable = 2;
Object.defineProperty(proto, 'nonEnumerable', { value: 2, enumerable: false });

const context = Object.create(proto);
context.own = 0;

const cloned = { ...context };
console.log(JSON.stringify({
  identity: Object.is(context, cloned),
  own: cloned.own,
  inherited: cloned.inherited,
  nonEnumerable: cloned.nonEnumerable,
  ownKeys: Object.keys(Object.create(null)),
  enumerableOwnSymbols: Object.getOwnPropertySymbols(cloned).length
}));

let seenThis;
function check() { seenThis = Object.is(this, context) }
context.callPolyfill = function () {};
Object.assign(context, { callPolyfill() {} });

const object = { ...context };
object.check = check;
object.check();
console.log(JSON.stringify({ spreadsFunctionCallsWithProtoAndNonEnumerable: context.check(), clonedCallsWithProtoAndNonEnumerable: object.check() }));

const context2 = { a: 1 };
const cloned2 = { ...context2 };
cloned2.check = function () { return Object.is(this, context2) };
cloned2.check();
console.log(JSON.stringify({ clonedDoesNotPreserveIdentity: cloned2.check() }));
JS

Repository: Faustze/notes

Length of output: 1059


🏁 Script executed:

#!/bin/bash
set -euo pipefail

node - <<'JS'
const proto = { inherited: 1 };
const nonEnumerable = { nonEnumerable: 2 };
Object.defineProperty(nonEnumerable, 'nonEnumerable', { value: 2, enumerable: false });

const context = Object.create(proto);
Object.assign(context, { own: 0, ...nonEnumerable });
const cloned = Object.assign({}, context);

console.log(JSON.stringify({
  identity: Object.is(context, cloned),
  own: cloned.own,
  inherited: cloned.inherited,
  nonEnumerable: cloned.nonEnumerable,
  enumerableOwnSymbols: Object.getOwnPropertySymbols(cloned).length
}));

let seenThis;
function check() { seenThis = Object.is(this, context) }
context.check = check;

const object = Object.assign({}, context);
object.check = check;
object.check();

console.log(JSON.stringify({ originalContextPreservesPrototypeAndNonEnumerable: context.check(), clonedContextLosesPrototypeAndNonEnumerable: object.check() }));

const context2 = { a: 1 };
const cloned2 = Object.assign({}, context2);
cloned2.check = function () { return Object.is(this, context2) };
cloned2.check();
console.log(JSON.stringify({ clonedDoesNotPreserveIdentity: cloned2.check() }));

const target = { a: 1 };
Reflect.setPrototypeOf(target, { inherited: 2 });
const spreadTarget = { ...target };
const spreadWithOwnSymbol = { ...target, [Symbol.iterator]: 0 };
console.log(JSON.stringify({ symbolOverwritesProtoSymbols: Object.getOwnPropertySymbols(spreadWithOwnSymbol).some(s => s === Symbol.iterator) }));
JS

Repository: Faustze/notes

Length of output: 284


Preserve the original this context.

{ ...context } creates a new object, so identity checks fail; Reflect.ownKeys(Object.assign({}, context)) and { ...context } also drop the inherited prototype chain and non-enumerable own properties, while spread copies Symbol keys before prototype properties. Use the supplied context directly, assign the wrapper property, call through it, then clean it up.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@content-ru/leetcode/Untagged/2693-call-function-with-custom-context.md`
around lines 20 - 25, Update the wrapper logic around the context object to use
the supplied context directly instead of creating a spread copy, preserving its
identity, prototype chain, and non-enumerable properties. Assign the temporary
symbol property to that original context, invoke the function through it, and
remove the temporary property afterward while preserving the existing argument
forwarding behavior.

@Faustze
Faustze merged commit 97df5b8 into main Jul 24, 2026
7 checks passed
@Faustze
Faustze deleted the chore/translate-new-notes branch July 24, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant