CodeDrill
day_streak: --
← 問題一覧に戻る
Python ・ Standard I/O

Problem 53: Anagram Check

A string S is given on the first line, and a string T is given on the second line. If the letters of S can be rearranged to form T, output Yes; otherwise, output No.

Constraints

1 ≤ length of S, T ≤ 100, lowercase letters only

Input example 1

listen
silent

Output example 1

Yes

Input example 2

hello
world

Output example 2

No

What you'll train

Cover the edge cases

What you get

  • Handling mismatched lengths
  • Specify case sensitivity
  • State assumptions about character types

How to ask the AI

Tell the AI how to handle the case where S and T have different lengths, and whether to treat uppercase and lowercase letters as distinct. Clarifying whether the lengths are assumed to be equal, as in listen and silent, will also reduce misunderstandings.

If you ask vaguelyTrying to compare strings of different lengths causes an error, or the check ignores letter case when it shouldn't.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。