Featured image of post HackerRank: Message Decryptor

HackerRank: Message Decryptor

reverse string and put duplicate words as number of occurrences. disclaimer: use this for learning purpose, do not just copy paste

Problem

change the encrypted message into the original message. The number should be converted back into the letter. for example,

  • “man go2d a is Ananto” -> “Ananto is a good man”
  • “leke3r is het” -> “het is lekeeer”

Psuedo Code

  1. split the message into words
  2. for each word, check if it is a number
  3. if it is a number, convert it back into the letter
  4. join the words back together in reverse order

Solution

Java

comments powered by Disqus