Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate sub category summary #1699

Merged
merged 17 commits into from
Sep 26, 2023
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -176,6 +176,11 @@
### 7. 数学知识
-->

## 其他专题

- [JavaScript 专项练习](/solution/JAVASCRIPT_README.md)
- [Database 专项练习](/solution/DATABASE_README.md)

## 加入我们

刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」​ 本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 [@kfstorm](https://github.com/kfstorm) 贡献了本项目的所有 [C# 题解](https://github.com/doocs/leetcode/pull/245)。
5 changes: 5 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -172,6 +172,11 @@ The repository is maintained by the Doocs community, and please give us a [star]
### 7. Mathematical Knowledge
-->

## Other categories

- [JavaScript Practice](/solution/JAVASCRIPT_README_EN.md)
- [Database Practice](/solution/DATABASE_README_EN.md)

## Contributions

I'm looking for long-term contributors/partners to this repo! Send me [PRs](https://github.com/doocs/leetcode/pulls) if you're interested! See the following:
23 changes: 22 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -2,14 +2,31 @@ const isEn = () => location.hash.includes('README_EN');

const isRoot = () => ['', '#/', '#/README', '#/README_EN'].includes(location.hash);

const sidebar = () => (isRoot() ? false : isEn() ? 'summary_en.md' : 'summary.md');
const getSolutionPrefix = url => {
const categories = ['javascript', 'shell', 'database'];
const res = categories.find(category => url.includes(category + '-solution'));
return res ? res + '-' : '';
};

const sidebar = () => {
if (isRoot()) {
return false;
}
const prefix = getSolutionPrefix(location.hash);
return isEn() ? `${prefix}summary_en.md` : `${prefix}summary.md`;
};

const cleanedHtml = html => {
return html.replace(/<pre>([\s\S]*?)<\/pre>/g, (_, group) => {
return '<pre>' + group.replace(/<code>([\s\S]*?)<\/code>/g, '$1') + '</pre>';
});
};

const replaceHref = html => {
const replacement = getSolutionPrefix(location.hash) + 'solution';
return replacement ? html.replace(/\/solution\//g, `/${replacement}/`) : html;
};

const getLang = () => (isEn() ? 'en' : 'zh-CN');

const giscusTheme = () =>
@@ -34,6 +51,9 @@ window.$docsify = {
auto2top: true,
subMaxLevel: 2,
alias: {
'^/javascript-solution/(.*)': '/solution/$1',
'^/shell-solution/(.*)': '/solution/$1',
'^/database-solution/(.*)': '/solution/$1',
'/lcs/.*/summary.md': '/lcs/summary.md',
'/lcp/.*/summary.md': '/lcp/summary.md',
'/lcci/.*/summary.md': '/lcci/summary.md',
@@ -128,6 +148,7 @@ window.$docsify = {
const github = `[GitHub](${url})`;
const gitee = `[Gitee](${url.replace('github', 'gitee')})`;
html = cleanedHtml(html);
html = replaceHref(html);
const editHtml = isEn()
? `:memo: Edit on ${github} / ${gitee}\n`
: `:memo: 在 ${github} / ${gitee} 编辑\n`;
251 changes: 251 additions & 0 deletions solution/DATABASE_README.md

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions solution/DATABASE_README_EN.md

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions solution/JAVASCRIPT_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# JavaScript 专项练习

[English Version](/solution/JAVASCRIPT_README_EN.md)

## 题解

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 | 备注 |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ---- | ---- |
| 2618 | [检查是否是类的对象实例](/javascript-solution/2600-2699/2618.Check%20if%20Object%20Instance%20of%20Class/README.md) | | 中等 | |
| 2619 | [数组原型对象的最后一个元素](/javascript-solution/2600-2699/2619.Array%20Prototype%20Last/README.md) | | 简单 | |
| 2620 | [计数器](/javascript-solution/2600-2699/2620.Counter/README.md) | | 简单 | |
| 2621 | [睡眠函数](/javascript-solution/2600-2699/2621.Sleep/README.md) | | 简单 | |
| 2622 | [有时间限制的缓存](/javascript-solution/2600-2699/2622.Cache%20With%20Time%20Limit/README.md) | | 中等 | |
| 2623 | [记忆函数](/javascript-solution/2600-2699/2623.Memoize/README.md) | | 中等 | |
| 2624 | [蜗牛排序](/javascript-solution/2600-2699/2624.Snail%20Traversal/README.md) | | 中等 | |
| 2625 | [扁平化嵌套数组](/javascript-solution/2600-2699/2625.Flatten%20Deeply%20Nested%20Array/README.md) | | 中等 | |
| 2626 | [数组归约运算](/javascript-solution/2600-2699/2626.Array%20Reduce%20Transformation/README.md) | | 简单 | |
| 2627 | [函数防抖](/javascript-solution/2600-2699/2627.Debounce/README.md) | | 中等 | |
| 2628 | [完全相等的 JSON 字符串](/javascript-solution/2600-2699/2628.JSON%20Deep%20Equal/README.md) | | 中等 | 🔒 |
| 2629 | [复合函数](/javascript-solution/2600-2699/2629.Function%20Composition/README.md) | | 简单 | |
| 2630 | [记忆函数 II](/javascript-solution/2600-2699/2630.Memoize%20II/README.md) | | 困难 | |
| 2631 | [分组](/javascript-solution/2600-2699/2631.Group%20By/README.md) | | 中等 | |
| 2632 | [柯里化](/javascript-solution/2600-2699/2632.Curry/README.md) | | 中等 | 🔒 |
| 2633 | [将对象转换为 JSON 字符串](/javascript-solution/2600-2699/2633.Convert%20Object%20to%20JSON%20String/README.md) | | 中等 | 🔒 |
| 2634 | [过滤数组中的元素](/javascript-solution/2600-2699/2634.Filter%20Elements%20from%20Array/README.md) | | 简单 | |
| 2635 | [转换数组中的每个元素](/javascript-solution/2600-2699/2635.Apply%20Transform%20Over%20Each%20Element%20in%20Array/README.md) | | 简单 | |
| 2636 | [Promise 对象池](/javascript-solution/2600-2699/2636.Promise%20Pool/README.md) | | 中等 | 🔒 |
| 2637 | [有时间限制的 Promise 对象](/javascript-solution/2600-2699/2637.Promise%20Time%20Limit/README.md) | | 中等 | |
| 2648 | [生成斐波那契数列](/javascript-solution/2600-2699/2648.Generate%20Fibonacci%20Sequence/README.md) | | 简单 | |
| 2649 | [嵌套数组生成器](/javascript-solution/2600-2699/2649.Nested%20Array%20Generator/README.md) | | 中等 | |
| 2650 | [设计可取消函数](/javascript-solution/2600-2699/2650.Design%20Cancellable%20Function/README.md) | | 困难 | |
| 2665 | [计数器 II](/javascript-solution/2600-2699/2665.Counter%20II/README.md) | | 简单 | |
| 2666 | [只允许一次函数调用](/javascript-solution/2600-2699/2666.Allow%20One%20Function%20Call/README.md) | | 简单 | |
| 2667 | [创建 Hello World 函数](/javascript-solution/2600-2699/2667.Create%20Hello%20World%20Function/README.md) | | 简单 | |
| 2675 | [将对象数组转换为矩阵](/javascript-solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README.md) | | 中等 | 🔒 |
| 2676 | [节流](/javascript-solution/2600-2699/2676.Throttle/README.md) | | 中等 | 🔒 |
| 2677 | [分块数组](/javascript-solution/2600-2699/2677.Chunk%20Array/README.md) | | 简单 | |
| 2690 | [无穷方法对象](/javascript-solution/2600-2699/2690.Infinite%20Method%20Object/README.md) | | 简单 | 🔒 |
| 2691 | [不可变辅助工具](/javascript-solution/2600-2699/2691.Immutability%20Helper/README.md) | | 困难 | 🔒 |
| 2692 | [使对象不可变](/javascript-solution/2600-2699/2692.Make%20Object%20Immutable/README.md) | | 中等 | 🔒 |
| 2693 | [使用自定义上下文调用函数](/javascript-solution/2600-2699/2693.Call%20Function%20with%20Custom%20Context/README.md) | | 中等 | |
| 2694 | [事件发射器](/javascript-solution/2600-2699/2694.Event%20Emitter/README.md) | | 中等 | |
| 2695 | [包装数组](/javascript-solution/2600-2699/2695.Array%20Wrapper/README.md) | | 简单 | |
| 2700 | [两个对象之间的差异](/javascript-solution/2700-2799/2700.Differences%20Between%20Two%20Objects/README.md) | | 中等 | 🔒 |
| 2703 | [返回传递的参数的长度](/javascript-solution/2700-2799/2703.Return%20Length%20of%20Arguments%20Passed/README.md) | | 简单 | |
| 2704 | [相等还是不相等](/javascript-solution/2700-2799/2704.To%20Be%20Or%20Not%20To%20Be/README.md) | | 简单 | |
| 2705 | [精简对象](/javascript-solution/2700-2799/2705.Compact%20Object/README.md) | | 中等 | |
| 2715 | [执行可取消的延迟函数](/javascript-solution/2700-2799/2715.Timeout%20Cancellation/README.md) | | 简单 | |
| 2721 | [并行执行异步函数](/javascript-solution/2700-2799/2721.Execute%20Asynchronous%20Functions%20in%20Parallel/README.md) | | 中等 | |
| 2722 | [根据 ID 合并两个数组](/javascript-solution/2700-2799/2722.Join%20Two%20Arrays%20by%20ID/README.md) | | 中等 | |
| 2723 | [添加两个 Promise 对象](/javascript-solution/2700-2799/2723.Add%20Two%20Promises/README.md) | | 简单 | |
| 2724 | [排序方式](/javascript-solution/2700-2799/2724.Sort%20By/README.md) | | 简单 | |
| 2725 | [间隔取消](/javascript-solution/2700-2799/2725.Interval%20Cancellation/README.md) | | 简单 | |
| 2726 | [使用方法链的计算器](/javascript-solution/2700-2799/2726.Calculator%20with%20Method%20Chaining/README.md) | | 简单 | |
| 2727 | [判断对象是否为空](/javascript-solution/2700-2799/2727.Is%20Object%20Empty/README.md) | | 简单 | |
| 2754 | [将函数绑定到上下文](/javascript-solution/2700-2799/2754.Bind%20Function%20to%20Context/README.md) | | 中等 | 🔒 |
| 2755 | [深度合并两个对象](/javascript-solution/2700-2799/2755.Deep%20Merge%20of%20Two%20Objects/README.md) | | 中等 | 🔒 |
| 2756 | [批处理查询](/javascript-solution/2700-2799/2756.Query%20Batching/README.md) | | 困难 | 🔒 |
| 2757 | [生成循环数组的值](/javascript-solution/2700-2799/2757.Generate%20Circular%20Array%20Values/README.md) | | 中等 | 🔒 |
| 2758 | [下一天](/javascript-solution/2700-2799/2758.Next%20Day/README.md) | | 简单 | 🔒 |
| 2759 | [将 JSON 字符串转换为对象](/javascript-solution/2700-2799/2759.Convert%20JSON%20String%20to%20Object/README.md) | | 困难 | 🔒 |
| 2774 | [数组的上界](/javascript-solution/2700-2799/2774.Array%20Upper%20Bound/README.md) | | 简单 | 🔒 |
| 2775 | [将 undefined 转为 null](/javascript-solution/2700-2799/2775.Undefined%20to%20Null/README.md) | | 中等 | 🔒 |
| 2776 | [转换回调函数为 Promise 函数](/javascript-solution/2700-2799/2776.Convert%20Callback%20Based%20Function%20to%20Promise%20Based%20Function/README.md) | | 中等 | 🔒 |
| 2777 | [日期范围生成器](/javascript-solution/2700-2799/2777.Date%20Range%20Generator/README.md) | | 中等 | 🔒 |
| 2794 | [从两个数组中创建对象](/javascript-solution/2700-2799/2794.Create%20Object%20from%20Two%20Arrays/README.md) | | 简单 | 🔒 |
| 2795 | [并行执行 Promise 以获取独有的结果](/javascript-solution/2700-2799/2795.Parallel%20Execution%20of%20Promises%20for%20Individual%20Results%20Retrieval/README.md) | | 中等 | 🔒 |
| 2796 | [重复字符串](/javascript-solution/2700-2799/2796.Repeat%20String/README.md) | | 简单 | 🔒 |
| 2797 | [带有占位符的部分函数](/javascript-solution/2700-2799/2797.Partial%20Function%20with%20Placeholders/README.md) | | 中等 | 🔒 |
| 2803 | [阶乘生成器](/javascript-solution/2800-2899/2803.Factorial%20Generator/README.md) | | 简单 | 🔒 |
| 2804 | [数组原型的 forEach 方法](/javascript-solution/2800-2899/2804.Array%20Prototype%20ForEach/README.md) | | 简单 | 🔒 |
| 2805 | [自定义间隔](/javascript-solution/2800-2899/2805.Custom%20Interval/README.md) | | 中等 | 🔒 |
| 2821 | [延迟每个 Promise 对象的解析](/javascript-solution/2800-2899/2821.Delay%20the%20Resolution%20of%20Each%20Promise/README.md) | | 简单 | 🔒 |
| 2822 | [对象反转](/javascript-solution/2800-2899/2822.Inversion%20of%20Object/README.md) | | 简单 | 🔒 |
| 2823 | [深度对象筛选](/javascript-solution/2800-2899/2823.Deep%20Object%20Filter/README.md) | | 中等 | 🔒 |

## 版权

著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 [@yanglbme](mailto:contact@yanglibin.info) 获得授权,非商业转载请注明出处。
Loading