Computer science/알고리즘

[자바스크립트로 구현한 알고리즘] Exes and Ohs

남양주개발자 2016. 9. 21. 14:18
728x90
반응형



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 contains 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







728x90
반응형
그리드형