diff --git a/src/algorithms/cryptography/caesar-cipher/README.md b/src/algorithms/cryptography/caesar-cipher/README.md index 428b5a9772..d648a62ee9 100644 --- a/src/algorithms/cryptography/caesar-cipher/README.md +++ b/src/algorithms/cryptography/caesar-cipher/README.md @@ -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) diff --git a/src/algorithms/linked-list/traversal/README.md b/src/algorithms/linked-list/traversal/README.md index d1b74ea57e..9acbe98dd9 100644 --- a/src/algorithms/linked-list/traversal/README.md +++ b/src/algorithms/linked-list/traversal/README.md @@ -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. diff --git a/src/algorithms/string/knuth-morris-pratt/knuthMorrisPratt.js b/src/algorithms/string/knuth-morris-pratt/knuthMorrisPratt.js index 82b94904fd..a3a39904a4 100644 --- a/src/algorithms/string/knuth-morris-pratt/knuthMorrisPratt.js +++ b/src/algorithms/string/knuth-morris-pratt/knuthMorrisPratt.js @@ -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;