fixed small errors
This commit is contained in:
parent
6db72111bb
commit
1ed0103806
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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, `<Ctr> + 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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue