https://www.codewars.com/kata/577bd026df78c19bca0002c0
DESCRIPTION:
Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.
When documents (especially pretty old ones written with a typewriter), are digitised character recognition softwares often make mistakes.
Your task is correct the errors in the digitised text. You only have to handle the following mistakes:
- S is misinterpreted as 5
- O is misinterpreted as 0
- I is misinterpreted as 1
The test cases contain numbers only by mistake.
코드
function correct(string){
return string.replaceAll('5', 'S').replaceAll('0', 'O').replaceAll('1', 'I');
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Cat years, Dog years (8 kyu) / JavaScript (0) | 2023.04.12 |
---|---|
[Codewars] Area of a Square (8 kyu) / JavaScript (0) | 2023.04.12 |
[Codewars] Meeting (6 kyu) / JavaScript (0) | 2023.04.11 |
[Codewars] Return the day (8 kyu) / JavaScript (0) | 2023.04.10 |
[Codewars] Is it a palindrome? (8 kyu) / JavaScript (0) | 2023.04.09 |
댓글