fix: Some Ruby code (#1231)

* fix: ruby code block - chapter computational complexity

* fix: ruby code - chapter array and linkedlist
This commit is contained in:
khoaxuantu
2024-04-07 00:39:45 +07:00
committed by GitHub
parent db164f6703
commit 4fadad50ba
2 changed files with 8 additions and 8 deletions

View File

@@ -45,8 +45,8 @@ end
### 删除索引 index 处的元素 ###
def remove(nums, index)
# 把索引 index 之后的所有元素向前移动一位
for i in index...nums.length
nums[i] = nums[i + 1] || 0
for i in index...(nums.length - 1)
nums[i] = nums[i + 1]
end
end