6 kyu
Parse bank account number
454 of 1,222arhigod
Description:
Returns the bank account number parsed from specified string.
You work for a bank, which has recently purchased an ingenious machine to assist in reading letters and faxes sent in by branch offices.
The machine scans the paper documents, and produces a string with a bank account that looks like this:
_ _ _ _ _ _ _ _
| | | _| _||_||_ |_ ||_||_|
|_| ||_ _| | _||_| ||_| _|
Each string contains an account number written using pipes and underscores.
Each account number should have at least one digit, all of which should be in the range 0-9.
Your task is to write a function that can take bank account string and parse it into actual account numbers.
@param {string} bankAccount
@return {number}
Examples:
' _ _ _ _ _ _ _ \n'+
' | _| _||_||_ |_ ||_||_|\n'+ => 123456789
' ||_ _| | _||_| ||_| _|\n'
' _ _ _ _ _ _ _ _ _ \n'+
'| | _| _|| ||_ |_ ||_||_|\n'+ => 23056789
'|_||_ _||_| _||_| ||_| _|\n',
' _ _ _ _ _ _ _ _ _ \n'+
'|_| _| _||_||_ |_ |_||_||_|\n'+ => 823856989
'|_||_ _||_| _||_| _||_| _|\n',
(c)RSS
Strings
Puzzles
Similar Kata:
Stats:
Created | Jul 31, 2017 |
Published | Jul 31, 2017 |
Warriors Trained | 3398 |
Total Skips | 90 |
Total Code Submissions | 5519 |
Total Times Completed | 1222 |
JavaScript Completions | 420 |
C Completions | 52 |
Java Completions | 203 |
C++ Completions | 114 |
Python Completions | 454 |
Rust Completions | 28 |
Total Stars | 93 |
% of votes with a positive feedback rating | 94% of 277 |
Total "Very Satisfied" Votes | 243 |
Total "Somewhat Satisfied" Votes | 32 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |