Problem Statement | |||||||||||||
You are given a String spell containing an ancient magic spell. The spell is encrypted, but the cypher is quite simple. To decrypt the spell, you need to find all occurrences of the letters 'A' and 'Z', and then reverse their order. For example, if the encrypted spell is "AABZCADZA", you would first find all the 'A's and 'Z's: "AA_Z_A_ZA". You would then reverse their order: "AZ_A_Z_AA". The final decrypted spell is "AZBACZDAA". Return the decrypted version of the given spell. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | spell will contain between 1 and 50 uppercase letters ('A'-'Z'), inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|