Decode NSE Stock Symbol Encoding
Decode NSE Stock Symbol Encoding
MediumStrings0% accepted
NSE Delhi uses a compressed format for stock symbols in trading logs. Format: First letter of company + count of each vowel (A, E, I, O, U) found in the rest of the name. For example, 'Apple' → 'A_2,1,0,0,1'. Priya needs to validate which codes could represent real company names.
Approach
Given a comma-separated list of compressed stock codes in format 'CHAR_COUNT1,COUNT2,COUNT3,COUNT4,COUNT5' representing vowel counts, determine if they're valid representations by checking if vowel distribution makes sense.
Input
A_2,1,0,0,1
Output
Valid
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards