Run the code and find out the hidden message!

Run the code and find out the hidden message!

import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args)  {
        decipherText();
    }
    

    public static void decipherText() {
        String jumbledWord = "Zh#duh#fxuuhqwo|#klulqj#iru#vriwzduh#hqjlqhhulqj#judgxdwh#surjudp/#sohdvh#hpdlo#xv#dw#judgkluh1p|Ch{shuldq1frp";
        String[] tips = {
                "Try",
                "To",
                "Solve"
        };
        String convertedWord = jumbledWord.chars()
                .map(asciiCharacter -> (asciiCharacter - tips.length))
                .mapToObj(newAscii  -> (char) newAscii)
                .map(singleCharacter -> Character.toString(singleCharacter))
                .collect(Collectors.joining(""));
        System.out.println(convertedWord);
    }
}

要查看或添加评论,请登录

社区洞察