vault backup: 2023-11-24 14:22:03
This commit is contained in:
10
.obsidian/workspace.json
vendored
10
.obsidian/workspace.json
vendored
@ -13,7 +13,7 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Prog/Collections.md",
|
||||
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
}
|
||||
@ -85,7 +85,7 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Prog/Collections.md",
|
||||
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@ -102,7 +102,7 @@
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Prog/Collections.md",
|
||||
"file": "Algo/B2/Exercises/Repetitive tutorial.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
@ -125,7 +125,7 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Prog/Collections.md"
|
||||
"file": "Algo/B2/Exercises/Repetitive tutorial.md"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -156,7 +156,7 @@
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "41ec48cdc3af71a1",
|
||||
"active": "c473a791e2b34194",
|
||||
"lastOpenFiles": [
|
||||
"Prog/Collections.md",
|
||||
"Algo/B2/Exercises/Repetitive tutorial.md",
|
||||
|
@ -72,3 +72,35 @@ def power(x, n):
|
||||
n -= 1
|
||||
return res
|
||||
```
|
||||
|
||||
## Exercise 1.4
|
||||
|
||||
```python
|
||||
def fibo(n: int) -> int:
|
||||
a = 0
|
||||
b = 1
|
||||
c = 0
|
||||
i = 2
|
||||
while i <= n:
|
||||
c = a + b
|
||||
a = b
|
||||
b = c
|
||||
i += 1
|
||||
return b
|
||||
```
|
||||
|
||||
## Exercise 1.5
|
||||
```python
|
||||
def my_sum(n: int) -> int:
|
||||
s = 0
|
||||
i = 1
|
||||
while i <= n:
|
||||
s += u(i)
|
||||
i += 1
|
||||
return s
|
||||
def my_sum(n: int) -> int:
|
||||
s = 0
|
||||
while n > 0:
|
||||
s += u(n)
|
||||
n -= 1
|
||||
return s
|
||||
|
Reference in New Issue
Block a user