https://www.codewars.com/kata/55908aad6620c066bc00002a
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:
Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any char.
Examples input/output:
XO("ooxx") => true
XO("xooxx") => false
XO("ooxXm") => true
XO("zpzpzpp") => true // when no 'x' and 'o' is present should return true
XO("zzoo") => false
설명:
문자열이 같은 수의 'x'와 'o'를 가지고 있는지 확인하세요. 메소드는 불리언은 반환하고 대소문자를 구분하지 않습니다. 문자열은 모든 문자를 포함할 수 있습니다.
예시 입력/출력:
XO("ooxx") => true
XO("xooxx") => false
XO("ooxXm") => true
XO("zpzpzpp") => true // when no 'x' and 'o' is present should return true
XO("zzoo") => false
'알고리즘 > Codewars' 카테고리의 다른 글
[Codewars] Jaden Casing Strings (7 kyu) / JavaScript (0) | 2022.11.22 |
---|---|
[Codewars] Duplicate Encoder (6 kyu) / JavaScript (0) | 2022.11.21 |
[Codewars] Counting Duplicates (6 kyu) / JavaScript (0) | 2022.11.18 |
[Codewars] Grasshopper - Basic Function Fixer (8 kyu) / JavaScript (0) | 2022.11.17 |
[Codewars] Function 1 - hello world (8 kyu) / JavaScript (0) | 2022.11.16 |
댓글