2023.05.14.SUN

ronglong·2023년 5월 14일
0

[ 프로그래머스 ]

  • 이진 변환 반복하기
    : 이진 변환 메서드는 검색해서 찾아봤다. Integer.toBinaryString();
class Solution {
    public int[] solution(String s) {
        int zero = 0;
        int change = 0;
        //문자열이 1이 될 때까지 반복
        while(s.length() > 1){
            //0 제거, 제거된 0 개수 카운트
            zero += s.length() - s.replaceAll("0", "").length();
            //0이 제거된 문자열의 길이를 이진 변환, 이진 변환 횟수 카운트
            s = Integer.toBinaryString(s.replaceAll("0", "").length());
            change++;
        }

        //[이진 변환 횟수, 제거한 0 개수] 리턴 
        return new int[]{change, zero};
    }
}

[ 유어클래스 다시 읽기 ]

  • section2. 웹 애플리케이션 작동원리
    : Web Application 3 Tier Architecture, SSR(검색엔진 최적화 SEO에 유리), CSR, CORS, HTTP, MIME TYPE

[ 칼퇴족 김대리는 알고 나만 모르는 SQL ]

  • order by 는 맨 마지막에.

0개의 댓글