This commit is contained in:
krahets
2024-03-21 04:22:07 +08:00
parent 35a07170c0
commit cfdb743939
52 changed files with 292 additions and 290 deletions

View File

@ -638,7 +638,7 @@ comments: true
func levelOrder() -> [Int] {
var res: [Int] = []
// 直接遍历数组
for i in stride(from: 0, to: size(), by: 1) {
for i in 0 ..< size() {
if let val = val(i: i) {
res.append(val)
}