Several bug fixes and improvements (#945)

* Update Dockerfile for code debugging.

* Format Python code using Black.

* Improve dark theme by defining html classes for the figures, animations and cover images.

* Fix several glossary translation.

* Update a code comment.

* Fix climbing_stairs_backtrack: the pruning should not require the sorted choices list.

* Update the code of array and list traversal.

* Fix a rendering issue of README.md

* Update code of list traversal.

* Fix array_definition.png

* Update README.md

* Fix max_capacity_moving_short_board.png

* Fix array.dart

* Fix array.dart

* Fix array.dart

* Fix array.dart
This commit is contained in:
Yudong Jin
2023-11-14 21:27:35 +08:00
committed by GitHub
parent 9baf4a1753
commit fcbaf101a4
64 changed files with 212 additions and 218 deletions

View File

@ -48,12 +48,12 @@ func remove(nums: inout [Int], index: Int) {
func traverse(nums: [Int]) {
var count = 0
//
for _ in nums.indices {
count += 1
for i in nums.indices {
count += nums[i]
}
//
for _ in nums {
count += 1
//
for num in nums {
count += num
}
}

View File

@ -42,14 +42,13 @@ enum List {
/* */
var count = 0
for _ in nums.indices {
count += 1
for i in nums.indices {
count += nums[i]
}
/* */
count = 0
for _ in nums {
count += 1
for x in nums {
count += x
}
/* */

View File

@ -14,7 +14,7 @@ func backtrack(choices: [Int], state: Int, n: Int, res: inout [Int]) {
for choice in choices {
// n
if state + choice > n {
break
continue
}
backtrack(choices: choices, state: state + choice, n: n, res: &res)
}