inblog logo
|
moohyun
    알고리즘문제풀기

    편지

    화낼거양's avatar
    화낼거양
    Nov 26, 2024
    편지
    Contents
    문제정답
     
     
    https://school.programmers.co.kr/learn/courses/30/lessons/120898
     

    문제

     
    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
    Contents
    문제정답

    moohyun

    RSS·Powered by Inblog