Fifty-Fifty

AtCoder
IDabc132_a
Time2000ms
Memory256MB
Difficulty
You are given a $4$\-character string $S$ consisting of uppercase English letters. Determine if $S$ consists of exactly two kinds of characters which both appear twice in $S$. ## Constraints * The length of $S$ is $4$. * $S$ consists of uppercase English letters. ## Input Input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
ASSA
Output #1
Yes

$S$ consists of `A` and `S` which both appear twice in $S$.
Input #2
STOP
Output #2
No
Input #3
FFEE
Output #3
Yes
Input #4
FREE
Output #4
No
API Response (JSON)
{
  "problem": {
    "name": "Fifty-Fifty",
    "description": {
      "content": "You are given a $4$\\-character string $S$ consisting of uppercase English letters. Determine if $S$ consists of exactly two kinds of characters which both appear twice in $S$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc132_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a $4$\\-character string $S$ consisting of uppercase English letters. Determine if $S$ consists of exactly two kinds of characters which both appear twice in $S$.\n\n## Constraints\n\n*   The...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments