080. 1337 5p34k

Codeforces
IDCF10269080
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Leet, (also known as 1337 sp34k or Elite Speak), was a prominent use of letter swapping during early internet culture. Set types of letters would be able to be substituted for different numbers which would have similarities to the letters they were replacing. For this basic translator, only these conversions are needed: _a_ = 4 _b_ = 8 _e_ = 3 _i_ = 1 _l_ = 1 _o_ = 0 _s_ = 5 _t_ = 7 _z_ = 2 Will contain a single string to be translated Return a leet translated piece of string ## Input Will contain a single string to be translated ## Output Return a leet translated piece of string [samples]
**Definitions** Let $ S $ be a string over the alphabet $ \Sigma = \{a, b, c, \dots, z, A, B, \dots, Z, \text{digits}, \text{punctuation}, \dots\} $. Let $ \sigma: \{a, b, e, i, l, o, s, t, z\} \to \{4, 8, 3, 1, 1, 0, 5, 7, 2\} $ be the substitution mapping: $$ \sigma(a) = 4,\ \sigma(b) = 8,\ \sigma(e) = 3,\ \sigma(i) = 1,\ \sigma(l) = 1,\ \sigma(o) = 0,\ \sigma(s) = 5,\ \sigma(t) = 7,\ \sigma(z) = 2 $$ **Constraints** - $ S $ contains only printable ASCII characters. - Only lowercase letters $ \{a, b, e, i, l, o, s, t, z\} $ are subject to substitution; all other characters remain unchanged. - Uppercase variants of these letters are **not** substituted. **Objective** Compute the transformed string $ S' $ such that for each character $ c \in S $: $$ S'[i] = \begin{cases} \sigma(c) & \text{if } c \in \{a, b, e, i, l, o, s, t, z\} \\ c & \text{otherwise} \end{cases} $$
API Response (JSON)
{
  "problem": {
    "name": "080. 1337 5p34k",
    "description": {
      "content": "Leet, (also known as 1337 sp34k or Elite Speak), was a prominent use of letter swapping during early internet culture.  Set types of letters would be able to be substituted for different numbers whic",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269080"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Leet, (also known as 1337 sp34k or Elite Speak), was a prominent use of letter swapping during early internet culture. \n\nSet types of letters would be able to be substituted for different numbers whic...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ S $ be a string over the alphabet $ \\Sigma = \\{a, b, c, \\dots, z, A, B, \\dots, Z, \\text{digits}, \\text{punctuation}, \\dots\\} $.  \n\nLet $ \\sigma: \\{a, b, e, i, l, o, s, t, z\\} \\...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments