We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defcaesarCipher(s:String,k:Int):String={// Write your code herevalshift=k%26s.map{char=>if(char.isLower){((char-'a'+shift)%26+'a').toChar}elseif(char.isUpper){((char-'A'+shift)%26+'A').toChar}else{char}}.mkString}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →
Scala solution