Skip to content

Translated Readme.md #71

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

Open
wants to merge 39 commits into
base: translate
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5c65a93
Init
Jul 18, 2018
ef29b82
Finished the Symmetric Difference
Jul 22, 2018
53201c0
修改人称词
Jul 22, 2018
cc924ea
优化
Jul 22, 2018
ddb9874
Finished Inventory Update
Jul 22, 2018
6228f6e
test
Jul 22, 2018
06f1645
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 22, 2018
7a878eb
Undone
Jul 22, 2018
d8c8d1f
Format by pangu
Jul 23, 2018
08448f4
与其他页面的相同信息保持一致
Jul 24, 2018
584cb36
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 24, 2018
96a9f21
No Repeats Please
Jul 24, 2018
b1fa337
Modified by reviwer
Jul 26, 2018
3978feb
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 27, 2018
bf7dafa
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 27, 2018
a8a6f1e
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 28, 2018
575325b
modified the space of chinese && code
Jul 28, 2018
a8c193d
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 30, 2018
8e2312f
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Jul 31, 2018
b686c28
Modified by reviwer
Jul 31, 2018
d888fa9
Delete the space
Jul 31, 2018
83a8be9
Modified by reviwer
Aug 5, 2018
df7b55e
Modified by reviwer
Aug 6, 2018
d13f955
Recover space
Aug 6, 2018
e1eab52
Translated ReadMe
Aug 6, 2018
09e6e8b
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Aug 7, 2018
d25d10a
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Aug 8, 2018
548005a
Merge branch 'translate' of https://github.com/leejay1992/challenges …
Aug 8, 2018
3e840f7
Merge branch 'translate' of github.com:FreeCodeCampChina/challenges i…
Aug 8, 2018
eb45f97
Merge branch 'translate' of https://github.com/leejay1992/challenges …
Aug 8, 2018
a49a9dd
Modified by reviwer
Aug 8, 2018
5f20dff
更新文件 README.md
huluoyang Aug 9, 2018
3db8adf
更新文件 README.md
huluoyang Aug 9, 2018
b4a0642
functional-programming.json complete
rainpure Aug 10, 2018
6cfdf39
Accept Merge Request #10: (functional-programming -> translate)
rainpure Aug 10, 2018
fdbc363
Revert "functional-programming.json complete"
rainpure Aug 10, 2018
9cb460e
Accept Merge Request #11: (revert-10-functional-programming -> transl…
S1ngS1ng Aug 10, 2018
dcc3431
Merge branch 'translate' of https://e.coding.net/freecodecamp/challen…
Aug 11, 2018
7d767f6
algorithms json link
Aug 20, 2018
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
Prev Previous commit
Next Next commit
优化
  • Loading branch information
MoverLee committed Jul 22, 2018
commit cc924eaeed3be19ff483f39ac7d442c9bdb41bb2
4 changes: 2 additions & 2 deletions 08-coding-interview-prep/algorithms.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"知识提要:对称差 (Symmetric Difference),数学上,两个 <a href='https://baike.baidu.com/item/%E9%9B%86%E5%90%88/2908117' target='_blank'>集合</a> 的对称差是只属于其中一个集合,而不属于另一个集合的元素组成的集合,例如:集合 A = { 1, 2, 3} 和 B = { 2, 3, 4} 的对称差为 A &xutri; B = C = {1,4},。 集合论中的这个运算相当于布尔逻辑中的异或运算。<a href='https://baike.baidu.com/item/%E5%AF%B9%E7%A7%B0%E5%B7%AE' target='_blank'>百科</a>。",
"创建一个函数sym,输入两个或两个以上的数组作为参数,然后返回值为 **对称差** 的数组",
"思路:设定两个数组 (例如:<code>A = {1, 2, 3}</code>,<code>B = {2, 3, 4}</code>,)作为参数传入,返回对称差数组(<code>A &xutri; B = C = {1, 4}</code>),且数组元素具有唯一性(没有重复项)。",
"如果你遇到了难题,请点击 <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>帮助</a>。请尽量编写属于你自己的代码。尝试一下 **结对编程** 会有意料不到的惊喜哦。",
"如果你遇到了困难,请点击 <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>帮助</a>。请尽量编写属于你自己的代码。尝试一下 **结对编程** 会有意料不到的惊喜哦。",
],
"solutions": [
"function sym() {\n var arrays = [].slice.call(arguments);\n return arrays.reduce(function (symDiff, arr) {\n return symDiff.concat(arr).filter(function (val, idx, theArr) {\n return theArr.indexOf(val) === idx \n && (symDiff.indexOf(val) === -1 || arr.indexOf(val) === -1);\n });\n });\n}\nsym([1, 2, 3], [5, 2, 1, 4]);\n"
Expand Down Expand Up @@ -101,7 +101,7 @@
"title": "Inventory Update",
"description": [
"Compare and update the inventory stored in a 2D array against a second 2D array of a fresh delivery. Update the current existing inventory item quantities (in <code>arr1</code>). If an item cannot be found, add the new item and quantity into the inventory array. The returned inventory array should be in alphabetical order by item.",
"Remember to use <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
"如果你遇到了困难,请点击 <a href='http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514' target='_blank'>帮助</a>。请尽量编写属于你自己的代码。尝试一下 **结对编程** 会有意料不到的惊喜哦。",
],
"solutions": [
"function updateInventory(arr1, arr2) {\n arr2.forEach(function(item) {\n createOrUpdate(arr1, item);\n });\n // All inventory must be accounted for or you're fired!\n return arr1;\n}\n\nfunction createOrUpdate(arr1, item) {\n var index = -1;\n while (++index < arr1.length) {\n if (arr1[index][1] === item[1]) {\n arr1[index][0] += item[0];\n return;\n }\n if (arr1[index][1] > item[1]) {\n break;\n }\n }\n arr1.splice(index, 0, item);\n}\n\n// Example inventory lists\nvar curInv = [\n [21, 'Bowling Ball'],\n [2, 'Dirty Sock'],\n [1, 'Hair Pin'],\n [5, 'Microphone']\n];\n\nvar newInv = [\n [2, 'Hair Pin'],\n [3, 'Half-Eaten Apple'],\n [67, 'Bowling Ball'],\n [7, 'Toothpaste']\n];\n\nupdateInventory(curInv, newInv);\n"
Expand Down