Hide

Problem G
Breaking into the Death Star

R2D2 must somehow unlock the entrance to a small starfighter to allow Luke, Leia, and Han to get themselves up to the Death Star, confront the Emperor and Vader, and save the galaxy. The plans are ready - it’s just a matter of executing them. Although R2 was programmed by the greatest software developers and engineers of his time, it still has trouble with strings and splitting (it got shot this one time and messed up his ALU, and also it is really old). Typically, Leia helps it out, but this time R2 is asking the interwebs (you) for help.

The fundamentals behind cracking the Death Star locks are relatively simple:

  1. All vowels are left as-is

  2. All dashes are replaced by newlines

  3. single digits are replaced by their binary form (this is true even when multiple integers are side-by-side: $64$ would convert to $11010$, not $1000000$)

  4. All other input characters are replaced by the string $beepbloop$

Input

The input given to R2 will be delivered in a single string. This string will consist of alphabet characters, numbers, and/or hyphens - not all these elements absolutely need to be present for any given input. Input length $l$ will be $1 \leq l \leq 50$. No other forms of punctuation or symbols will be present. All letters will be lowercase, so capitalization should not matter.

Output

The program simply outputs the translated inputs that R2D2 is receiving and outputting back to the Death Star controls. The output must be composed of the string “bleepbloop”, binary numbers, and vowels appearing in different frequencies.

Sample Input 1 Sample Output 1
hello-order66
beepbloopebeepbloopbeepbloopo
obeepbloopbeepbloopebeepbloop110110
Sample Input 2 Sample Output 2
tw1l3k-0b1k3n0b1
beepbloopbeepbloop1beepbloop11beepbloop
0beepbloop1beepbloop11beepbloop0beepbloop1

Please log in to submit a solution to this problem

Log in