Submit | All submissions | Best solutions | Back to list |
NSA - Name Scraping |
Description
The NSA is analyzing their data and looking for possible names.
A name starts with an uppercase letter and is followed by zero or more letters (of any case).
For example, Ben, McKay, and T are names; ben, mcKay, and T_ are not names.
Given an sequence of characters, how many names are there?
For example, Ben_aT8McK has eight names:
- B
- M
- K
- T
- Be
- Mc
- Ben
- McK
Input
A non-empty sequence of up to 30,000 characters. All characters are ASCII letters, numbers, or underscores.
Output
The number of names. Include any duplicates in your count.
Input | Input | Input | Input |
---|---|---|---|
Ben_McK8aT |
correct_horse_battery_staple |
ABCDEFGHIKLMNOPQRSTUVWXYZ |
LL1 |
Output | Output | Output | Output |
8 |
0 |
325 |
3 |
Added by: | BYU Admin |
Date: | 2013-10-18 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |