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

Stats:

CreatedJul 31, 2017
PublishedJul 31, 2017
Warriors Trained3398
Total Skips90
Total Code Submissions5519
Total Times Completed1222
JavaScript Completions420
C Completions52
Java Completions203
C++ Completions114
Python Completions454
Rust Completions28
Total Stars93
% of votes with a positive feedback rating94% of 277
Total "Very Satisfied" Votes243
Total "Somewhat Satisfied" Votes32
Total "Not Satisfied" Votes2
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • arhigod Avatar
  • ZED.CWT Avatar
  • clcraig Avatar
  • felix95 Avatar
  • bconniff Avatar
  • saudiGuy Avatar
Ad