A sentence with words separated by spaces is given on the first line, and a word W is given on the second line. When the sentence is split into words, output how many words exactly match W. (ab and abc do not match.)
Constraints
The sentence has between 1 and 50 words; each word and W consist of lowercase letters only, 1 to 20 characters long
Input example 1
the cat and the dog
theOutput example 1
2Input example 2
a b c
dOutput example 2
0What you'll train
State the constraints
What you get
How to ask the AI
Clearly tell the AI the condition that partial matches like "ab" within "abc" should not be counted — only words that exactly match should be counted.
If you ask vaguelyChecking whether the string is contained within another, causing "ab" inside "abc" to be counted as a match.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。