Woburn Challenge 2015-16 Round 4 - Junior Division
Problem 2: Mission Briefing
You've gotten your hands on M's writeup of plans for an upcoming MI6 mission. This mission briefing is a single string, whose length is between 1 and 1000 (inclusive), and which consists only of letters, digits, periods, and commas (no whitespace).
You know that 9 different MI6 agents may be involved in this mission – the agents with code names 001, 002, 003, 004, 005, 006, 007, 008, and 009. Some of their code names may appear in the mission briefing, even multiple times, while others may not. Their code names may occur anywhere in the string, not necessarily immediately before or after punctuation. You're interesting in counting the number of different agents whose code names can be found in the text at least once.
The first and only line of input consists of a single string representing a transcript of the the mission briefing.
Output a single integer – the number of different agents (from 001 to 009) whose code names appear in the mission briefing.
Point Value: 7
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2016
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3