From 1ed01038063cfd8b6e3bc2fbfe27d48e7beb8190 Mon Sep 17 00:00:00 2001 From: anebz Date: Wed, 1 Apr 2020 16:28:42 +0200 Subject: [PATCH] fixed small errors --- 05. Bit manipulation/5.3. Flip Bit to Win.md | 2 +- Missing CS semester/README.md | 4 ++-- README.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/05. Bit manipulation/5.3. Flip Bit to Win.md b/05. Bit manipulation/5.3. Flip Bit to Win.md index 1831312..7aa0842 100644 --- a/05. Bit manipulation/5.3. Flip Bit to Win.md +++ b/05. Bit manipulation/5.3. Flip Bit to Win.md @@ -1,6 +1,6 @@ # 5.3. Flip Bit to Win -> You have an integer and you can flip exactly one bit from a 0 to a 1. Write code to find the length of the longest sequence of 1s you could create. Input: 1775, or 11011101111, Output: 8 +> You have an integer and you can flip exactly one bit from a 0 to a 1. Write code to find the length of the longest sequence of 1s you could create. Input: 1775, or 11011101111, Output: 8 Brute force idea: find all 0s, flip all of them, count all 1s sequences (how?), output max. diff --git a/Missing CS semester/README.md b/Missing CS semester/README.md index bbf7d15..543b05a 100644 --- a/Missing CS semester/README.md +++ b/Missing CS semester/README.md @@ -186,7 +186,7 @@ To enter **Command line mode**, type `:`. * o / O insert line below / above * `A` append to line (in the end of line) * `d{motion}` delete {motion} - * e.g. dw is delete word, d$ is delete to end of line, d0 is* delete to beginning of line, d$ delete until end of line + * e.g. dw is delete word, d$ is delete to end of line, d0 is delete to beginning of line, d$ delete until end of line * `dd` delete whole line. 2dd, delete this and next line * `rx` to replace the character at the cursor by x. `ra`, deletes current character and writes a. * c{motion} change {motion} @@ -199,7 +199,7 @@ To enter **Command line mode**, type `:`. * visual mode + manipulation * select text, d to delete it or c to change it * `u` to undo, `U` to undo whole line, ` + R` to redo -* y to copy / “yank” (some other commands like d also copy) +* `y` to copy / “yank” (some other commands like d also copy) * `p` to paste under the cursor * Lots more to learn: e.g. ~ flips the case of a character diff --git a/README.md b/README.md index 90ebae8..e2aa410 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ If you can't afford to buy the book, you can find a free pdf [here](http://ahmed * Insert bit * Binary to string +* Flip bit to create longest sequence of 1s ## Chapter 7 Object-oriented design