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:
_ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_| ||_ _| | _||_| ||_| _|
... why did we buy this machine?
Anyway, your task is to write a function that can take bank account string and parse it into actual account numbers.
Example
_ _ _ _ _ _ _ _ _ | | _| _|| ||_ |_ ||_||_| => 23056789 |_||_ _||_| _||_| ||_| _|
Tests
_ _ _ _ _ _ _ _ _ |_| _| _||_||_ |_ |_||_||_| |_||_ _||_| _||_| _||_| _| _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_| ||_ _| | _||_| ||_| _|
Good luck!
This challenge comes from arhigod on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge idea for a future post? Email yo+challenge@dev.to with your suggestions!