https://www.codewars.com/kata/58b8c94b7df3f116eb00005b
Codewars - Achieve mastery through coding practice and developer mentorship
A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!
www.codewars.com
DESCRIPTION:
Task
Given a string str, reverse it and omit all non-alphabetic characters.
Example
For str = "krishan", the output should be "nahsirk".
For str = "ultr53o?n", the output should be "nortlu".
Input/Output
- [input] string str
A string consists of lowercase latin letters, digits and symbols.
- [output] a string
코드
function reverseLetter(str) {
return str.replace(/[^a-z]/ig, "").split('').reverse().join('');
}
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Plural (8 kyu) / JavaScript (0) | 2023.02.05 |
---|---|
[Codewars] Will there be enough space? (8 kyu) / JavaScript (0) | 2023.02.04 |
[Codewars] Count characters in your string (6 kyu) / JavaScript (0) | 2023.02.02 |
[Codewars] Parse nice int from char problem (8 kyu) / JavaScript (0) | 2023.02.01 |
[Codewars] Sum of the first nth term of Series (7 kyu) / JavaScript (0) | 2023.01.31 |
댓글