Need some hints and ideas to code the following problems. I have done question 5. it's just for the reference for question 6.Thanks
4) The Evil E is back and it brought back some friends! Write a method that will acknowledge that the letter E is evil. Each letter E will eliminate the characters around it. But the Evil Es will not eliminate its friends. So it will not eliminate the letters e or E.
evilEs("HELLO") --> " E LO"
evilEs("dEep") --> " Eep"
evilEs("Evil") --> "E il"
evilEs("bean") --> "bean"
evilEs("AbEEmgmEeodE") --> "A EE g Eeo E"
evilEs("ELEPHANT") --> "E E HANT"
evilEs("HomepagE") --> "Homepa E"
5) Write a method that will encode a given string in the following format.
encode("Hello") -> "leHlo"
encode("abcdef") -> "fdbace"
encode("ILoveJava") -> "vJvLIoeaa"
encode("mnopqrstuv") -> "vtrpnmoqsu"
6) Write a method that will undo the encoding in question 5. So this method will decode a String that is returned in the format of question 5.
(This one is much more complicated than question 5)
decode("leHlo") -> "Hello"
decode("fdbace") -> "abcdef"
decode("vJvLIoeaa") -> "ILoveJava"