Suppose that a string s consisting of both lower-case and upper-case letters are given. Write a function "solution" to return True when the number of 'p' and 'y' in s are the same, and return False otherwise. Note that when there is neither 'p' nor 'y', it should always return True. Also, when comparing the number of 'p' and 'y', lower-case and upper-case are not distinguished.

For example, if s is "pPoooyY", then return true. In the case of "Pyy", return false.

  • Length of string s : natural number less than 50.
  • String s consists of letters only.

s answer
"pPoooyY" true
"Pyy" false

Example #1
Since the number of 'p' is and 'y' is the same as 2, return true.

Example #2
Since the number of 'p' is 1 whereas the number of 'y' is 2, they are different. Hence return false.

Result Stop
내가 제출한 코드가 왜 틀렸는지 프로그래머스 AI에게 물어보세요.
제출 후 채점하기를 눌러 30점 이상인 경우 물어볼 수 있어요.
베타 기간 동안에는 한 문제당 1번만 물어볼 수 있어요.