競プロ典型問題の解法パターンと実装テクニック
文字列の構成要素検証
与えられた3文字の文字列が"A"、"B"、"C"の3種類の文字のみで構成されているかを判定する問題。文字の順序は問わず、各文字が1回ずつ出現するかを確認する必要がある。
#include <iostream>
#include <array>
using namespace std;
int main() {
string input;
cin >> input;
array<int, 3> count = {0};
...
8月27日 22:31 投稿