편지
Contents
문제정답
 
 
 

문제

 
notion image
 
기본적으로 주어진 코드 :
class Solution { public int solution(String message) { int answer = 0; return answer; } }
 

정답

 
class Solution { public int solution(String message) { int answer = message.length() * 2; return answer; } }
 
 
  • 한 글자당 2cm 의 길이를 가지고 있기 때문에 message 문자열의 총 길이에 2를 곱한 값을 return합니다.
Share article

moohyun