README fixes.

This commit is contained in:
Oleksii Trekhleb 2022-01-22 10:50:33 +01:00
parent 80d2f508d3
commit 7d13e6863a
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# Caesar Cipher Algorithm
_Read this in other languages:_
[_Русский_](README.ru-RU.md)
In cryptography, a **Caesar cipher**, also known as **Caesar's cipher**, the **shift cipher**, **Caesar's code** or **Caesar shift**, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of `3`, `D` would be replaced by `A`, `E` would become `B`, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
![Caesar Cipher Algorithm](https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg)

View File

@ -1,7 +1,7 @@
# Linked List Traversal
_Read this in other languages:_
[_Русский_](README.ru-RU.md)
[_Русский_](README.ru-RU.md),
[中文](README.zh-CN.md)
The task is to traverse the given linked list in straight order.

View File

@ -43,7 +43,7 @@ export default function knuthMorrisPratt(text, word) {
if (text[textIndex] === word[wordIndex]) {
// We've found a match.
if (wordIndex === word.length - 1) {
return textIndex - word.length + 1;
return (textIndex - word.length) + 1;
}
wordIndex += 1;
textIndex += 1;