Count a given letter (chat) · SmolLM2 360M
Statement
Input comes in the form word / letter. You must print how many times that letter appears in that word, as an integer. Only the last integer is graded.
| Input line | Expected output |
|---|---|
| strawberry / r | 3 |
In strawberry the r sits in the 3rd, 8th and 9th positions. The model does not see a word character by character, so it easily drops one and answers 2. Since only the last integer is read, you can let it write the counting out first.
Input
The input arrives as one line.
The input is between 10 and 15 characters long.
Output
Print one of
2,3or4on the first line.Do not add any other characters.
Not a single character may differ from the expected value.
Requirements
- The input has the form
strawberry / r. - The output is the number of occurrences written as an integer.
- This is chat mode. The prompt is wrapped in a chat template, so the model becomes an assistant. You can write control tokens yourself to build a conversation of several turns.
- Only the last integer of the output is read. You may write the working before it.
- This problem is solved with SmolLM2 360M. It is a far smaller model than Qwen3 0.6B, so the same prompt does not simply carry over.
- There are 16 cases, and 5 of them show the input together with the expected output. The rest show the input only.
- Model output is accepted up to 8 tokens.
- You have to pass all 16 cases to solve this.
Examples
5 public cases. Judging also uses hidden cases. You have to pass all 16 cases to solve this.
strawberry / r
3
banana / a
3
committee / m
2
parallel / l
3
mississippi / s
4
Notes
Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.
SmolLM2 360M is a fraction of the size of Qwen3 0.6B. It lets instructions slide far more often. You have to say the same thing more briefly and more clearly for it to listen.