-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update problem document and optimize code (#13)
- Loading branch information
Showing
56 changed files
with
821 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,8 @@ | |
"./src" | ||
], | ||
[ | ||
"@exercises", | ||
"./exercises" | ||
"@problems", | ||
"./problems" | ||
] | ||
] | ||
}, | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,118 @@ | ||
{ | ||
"code": { | ||
"en": "Code", | ||
"zh-cn": "代码" | ||
"zhCN": "代码" | ||
}, | ||
"problem_list": { | ||
"en": "Problem List", | ||
"zh-cn": "题目列表" | ||
"zhCN": "题目列表" | ||
}, | ||
"type_to_search": { | ||
"en": "Type to search...", | ||
"zh-cn": "请输入关键词搜索" | ||
"zhCN": "请输入关键词搜索" | ||
}, | ||
"setting": { | ||
"en": "setting", | ||
"zh-cn": "设置" | ||
"zhCN": "设置" | ||
}, | ||
"case": { | ||
"en": "Case", | ||
"zh-cn": "示例" | ||
"zhCN": "示例" | ||
}, | ||
"no_data": { | ||
"en": "No data", | ||
"zh-cn": "暂无数据" | ||
"zhCN": "暂无数据" | ||
}, | ||
"please_run_or_submit_first": { | ||
"en": "Please run or submit your code first", | ||
"zh-cn": "请先运行或提交您的代码" | ||
"zhCN": "请先运行或提交您的代码" | ||
}, | ||
"run_code": { | ||
"en": "Run", | ||
"zh-cn": "运行示例" | ||
"zhCN": "运行示例" | ||
}, | ||
"submit_code": { | ||
"en": "Submit", | ||
"zh-cn": "提交" | ||
"zhCN": "提交" | ||
}, | ||
"description": { | ||
"en": "Description", | ||
"zh-cn": "题目描述" | ||
"zhCN": "题目描述" | ||
}, | ||
"records": { | ||
"en": "Records", | ||
"zh-cn": "提交记录" | ||
"zhCN": "提交记录" | ||
}, | ||
"tutorial": { | ||
"en": "tutorial", | ||
"zh-cn": "题解" | ||
"zhCN": "题解" | ||
}, | ||
"theme": { | ||
"en": "theme", | ||
"zh-cn": "主题" | ||
"zhCN": "主题" | ||
}, | ||
"font_size": { | ||
"en": "font size", | ||
"zh-cn": "字体大小" | ||
"zhCN": "字体大小" | ||
}, | ||
"tab_size": { | ||
"en": "tab size", | ||
"zh-cn": "缩进大小" | ||
"zhCN": "缩进大小" | ||
}, | ||
"language": { | ||
"en": "language", | ||
"zh-cn": "语言" | ||
"zhCN": "语言" | ||
}, | ||
"cases": { | ||
"en": "Cases", | ||
"zh-cn": "测试用例" | ||
"zhCN": "测试用例" | ||
}, | ||
"result": { | ||
"en": "Result", | ||
"zh-cn": "运行结果" | ||
"zhCN": "运行结果" | ||
}, | ||
"status": { | ||
"en": "Status", | ||
"zh-cn": "状态" | ||
"zhCN": "状态" | ||
}, | ||
"time": { | ||
"en": "Time", | ||
"zh-cn": "提交时间" | ||
"zhCN": "提交时间" | ||
}, | ||
"options": { | ||
"en": "Options", | ||
"zh-cn": "选项" | ||
"zhCN": "选项" | ||
}, | ||
"operate": { | ||
"en": "Operate", | ||
"zh-cn": "操作" | ||
"zhCN": "操作" | ||
}, | ||
"view": { | ||
"en": "view", | ||
"zh-cn": "查看" | ||
"zhCN": "查看" | ||
}, | ||
"copy": { | ||
"en": "copy", | ||
"zh-cn": "复制" | ||
"zhCN": "复制" | ||
}, | ||
"successfully_delete": { | ||
"en": "Successfully deleted", | ||
"zh-cn": "删除成功" | ||
"zhCN": "删除成功" | ||
}, | ||
"failed_delete": { | ||
"en": "Failed to delete, please refresh page to retry", | ||
"zh-cn": "删除失败,请刷新重试" | ||
"zhCN": "删除失败,请刷新重试" | ||
}, | ||
"record_tip": { | ||
"en": "In order to save memory, we only save the latest 8 records. You can choose to manually delete some useless data to break this limit.", | ||
"zh-cn": "为了节省内存,我们仅保存最新的 8 条记录,您可以在达到限制后手动删除一些数据" | ||
"zhCN": "为了节省内存,我们仅保存最新的 8 条记录,您可以在达到限制后手动删除一些数据" | ||
}, | ||
"copied": { | ||
"en": "Copied", | ||
"zhCN": "复制成功" | ||
}, | ||
"request_error": { | ||
"en": "Network error, please check your network or refresh the page", | ||
"zhCN": "网络请求失败,请检查网络状况后刷新重试" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
problems/basic-tutorial/1-hello-world/docs/description/description.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
### What is TypeScript | ||
|
||
TypeScript is a syntactic superset of JavaScript which adds static typing. | ||
|
||
This basically means that TypeScript adds syntax on top of JavaScript, allowing developers to add types. | ||
|
||
### Why TypeScript | ||
|
||
JavaScript is a loosely typed language. It can be difficult to understand what types of data are being passed around in JavaScript. | ||
|
||
In JavaScript, function parameters and variables don't have any information! So developers need to look at documentation, or guess based on the implementation. | ||
|
||
TypeScript allows specifying the types of data being passed around within the code, and has the ability to report errors when the types don't match. | ||
|
||
For example, TypeScript will report an error when passing a string into a function that expects a number. JavaScript will not. | ||
|
||
### About this site | ||
|
||
To teach more people to use TypeScript including basic and advanced usage, we create this site which provides some problems should be solved by TypeScript. And part of the answers of the problems could be found at [official TypeScript document](https://www.typescriptlang.org/). | ||
|
||
This problem require you to export a type which equals to string `Hello, world`. | ||
|
||
Now, you can go to the editor at right of the page to start your TypeScript travel. | ||
|
||
**Reference** | ||
|
||
> 1.https://www.typescriptlang.org/ | ||
> | ||
> 2.https://www.w3schools.com/typescript/typescript_intro.php | ||
> | ||
> 3.https://github.com/typescript-exercises/typescript-exercises | ||
31 changes: 31 additions & 0 deletions
31
problems/basic-tutorial/1-hello-world/docs/description/description.zh-cn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
### 关于 TypeScript | ||
|
||
TypeScript 是 JavaScript 的语法超集,它添加了静态类型 | ||
|
||
这意味着 TypeScript 在 JavaScript 之上添加了语法,允许开发人员添加类型 | ||
|
||
### 为什么选择 TypeScript | ||
|
||
JavaScript 是一种松散类型语言。 理解 JavaScript 中传递的数据类型可能很困难 | ||
|
||
在 JavaScript 中,函数参数和变量没有任何信息!因此开发人员需要查看文档,或者根据实现进行猜测 | ||
|
||
TypeScript 允许指定代码中传递的数据类型,并且能够在类型不匹配时报告错误 | ||
|
||
例如,当将字符串传递到需要数字的函数时,TypeScript 将报告错误而 JavaScript 不会 | ||
|
||
### 关于本站 | ||
|
||
为了教会更多的人使用 TypeScript(包括基本和高级用法),我们创建了这个网站,根据 [TypeScript 官方文档](https://www.typescriptlang.org/)提供了从入门到精通 TypeScript 的练习题 | ||
|
||
这个问题要求你导出一个等于字符串`Hello, world`的类型 | ||
|
||
现在,您可以前往页面右侧的编辑器开始学习 TypeScript | ||
|
||
**参考** | ||
|
||
> 1.https://www.typescriptlang.org/ | ||
> | ||
> 2.https://www.w3schools.com/typescript/typescript_intro.php | ||
> | ||
> 3.https://github.com/typescript-exercises/typescript-exercises |
4 changes: 4 additions & 0 deletions
4
problems/basic-tutorial/1-hello-world/docs/description/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import en from './description.en.md?url'; | ||
import zhCN from './description.zh-cn.md?url'; | ||
|
||
export { en, zhCN }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
problems/basic-tutorial/2-everyday-types/docs/description/description.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Please replace all unknown and any in the code on the right with the correct type. | ||
|
||
**Reference** | ||
|
||
> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html |
5 changes: 5 additions & 0 deletions
5
problems/basic-tutorial/2-everyday-types/docs/description/description.zh-cn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
请将右侧代码中所有的 unknown 和 any 替换为正确的类型 | ||
|
||
**参考** | ||
|
||
> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html |
4 changes: 4 additions & 0 deletions
4
problems/basic-tutorial/2-everyday-types/docs/description/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import en from './description.en.md?url'; | ||
import zhCN from './description.zh-cn.md?url'; | ||
|
||
export { en, zhCN }; |
1 change: 0 additions & 1 deletion
1
...s/transpose-matrix/docs/tutorial/index.ts → ...l/2-everyday-types/docs/tutorial/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// @ts-ignore | ||
import en from './tutorial.en.md?url'; | ||
|
||
export { en }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
problems/difficulties/transpose-matrix/docs/description/description.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Given an $n \times m$ dimensional matrix type, input it as a generic and output the transpose of the matrix. | ||
|
||
Note that the following situations may exist in the matrix: | ||
|
||
1. If a row is empty, ignore the row. | ||
2. The number of elements in a row exceeds m, and the excess elements are ignored. |
6 changes: 6 additions & 0 deletions
6
problems/difficulties/transpose-matrix/docs/description/description.zh-cn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
给定一个 $n \times m$ 的矩阵类型,请将其作为泛型输入,并输出该矩阵的转置 | ||
|
||
注意,矩阵中可能存在如下情况: | ||
|
||
1. 某行为空,则忽略该行 | ||
2. 某行元素数目超出 m,忽略超出的元素 |
4 changes: 4 additions & 0 deletions
4
problems/difficulties/transpose-matrix/docs/description/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import en from './description.en.md?url'; | ||
import zhCN from './description.zh-cn.md?url'; | ||
|
||
export { en, zhCN }; |
1 change: 0 additions & 1 deletion
1
...l/2-everyday-types/docs/tutorial/index.ts → ...s/transpose-matrix/docs/tutorial/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// @ts-ignore | ||
import en from './tutorial.en.md?url'; | ||
|
||
export { en }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.