You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount.
794
+
795
+
A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus A ↔ N, B ↔ O and so on.
796
+
797
+
Write a function which takes a ROT13 encoded string as input and returns a decoded string.
798
+
799
+
All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.
800
+
801
+
802
+
803
+
```javascript
804
+
rot13("SERR PBQR PNZC") should decode to the string FREECODECAMP
805
+
806
+
rot13("SERR CVMMN!") should decode to the string FREEPIZZA!
807
+
808
+
rot13("SERR YBIR?") should decode to the string FREELOVE?
809
+
810
+
rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") should decode to the string THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG.
811
+
812
+
```
813
+
814
+
815
+
## Palindrome Checker
816
+
817
+
Return true if the given string is a palindrome. Otherwise, return false.
818
+
819
+
A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.
820
+
821
+
Note: You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything into the same case (lower or upper case) in order to check for palindromes.
822
+
823
+
We'll pass strings with varying formats, such as racecar, RaceCar, and race CAR among others.
824
+
825
+
We'll also pass strings with special symbols, such as 2A3*3a2, 2A3 3a2, and 2_A3*3#A2.
826
+
827
+
828
+
829
+
```javascript
830
+
palindrome("eye") should return a boolean.
831
+
832
+
palindrome("eye") should returntrue.
833
+
834
+
palindrome("_eye") should returntrue.
835
+
836
+
palindrome("race car") should returntrue.
837
+
838
+
palindrome("not a palindrome") should returnfalse.
839
+
840
+
palindrome("A man, a plan, a canal. Panama") should returntrue.
841
+
842
+
palindrome("never odd or even") should returntrue.
843
+
844
+
palindrome("nope") should returnfalse.
845
+
846
+
palindrome("almostomla") should returnfalse.
847
+
848
+
palindrome("My age is 0, 0 si ega ym.") should returntrue.
849
+
850
+
palindrome("1 eye for of 1 eye.") should returnfalse.
851
+
852
+
palindrome("0_0 (: /-\ :) 0-0") should returntrue.
0 commit comments