1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00

fix(blog): typos in posts

This commit is contained in:
Théo LUDWIG 2024-04-13 19:03:18 +02:00
parent c4650c34d9
commit 7febe6d1f9
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
2 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ It depends of many factors, and is somewhat relative to each one of us. The **pe
## Why is it so important?
Code like that works great, but it is not enough, even if the code will be read by the computer and understood by the machine, we should not forget that the code is **written by human** and will be also **read by human** not only a machine.
Code that works is great, but not enough, even if the code will be read and understood by the computer, we should not forget that the code is **written by human** and will be also **read by human** not only a machine.
For example the [Linux kernel](https://www.kernel.org/), is one of the biggest open source project with many contributors worldwide. Last data shows that it is about **20 millions** lines of code.

View File

@ -15,7 +15,7 @@ We don't want to "reinvent the wheel" and rewrite everything from scratch for ea
However, it is important to draw a line between what dependencies are worth the cost and which are not.
Most likely adding a [JavaScript npm package `is-odd`](https://www.npmjs.com/package/is-odd) to check if a number is odd or even for example, is not worth it. Writing it ourselves is easier and allows a better maintenance in the long term.
Most likely adding a [JavaScript npm package `is-odd`](https://www.npmjs.com/package/is-odd) to check if a number is odd or even for example, is not worth it. Writing it ourselves allows a better maintenance in the long term.
Learning **how to solve problems** and how to write efficient code is very important and also a very broad and complicated topic, so this blog post will only be an **introduction to the subject**, and will not go in depth.
@ -286,7 +286,7 @@ Contiguous subarray is any sub series of elements in a given array that are cont
**Explanation:** The subarray with the largest sum is `[2, 4, -3, 5, 2]` which has a sum of `10`.
### Worst solution: Brute force
### Worst solution: Brute force ($O(n^3)$)
```python
def maximum_subarray_sum_cubic(array: list[int]) -> int:
@ -309,7 +309,7 @@ def maximum_subarray_sum_cubic(array: list[int]) -> int:
return best_sum
```
### Better solution: Linear time
### Better solution: Linear time ($O(n)$)
```python
def maximum_subarray_sum_linear(array: list[int]) -> int: