[프로그래머스] 괄호변환 (C++)
·
코딩 테스트
🔮문제 programmers.co.kr/learn/courses/30/lessons/60058 코딩테스트 연습 - 괄호 변환 카카오에 신입 개발자로 입사한 "콘"은 선배 개발자로부터 개발역량 강화를 위해 다른 개발자가 작성한 소스 코드를 분석하여 문제점을 발견하고 수정하라는 업무 과제를 받았습니다. 소스를 programmers.co.kr 🔮풀이 1. P가 빈 문자열인 경우, 빈 문자열 "" 반환 2. 올바른 문자열인 경우, 입력 문자열 반환 3. 균형잡힌 문자열인 경우 3-1. u + v로 분리 (u : 균형, 분리x , v : 빈 문자열 ok) 3-2. u가 올바른 문자열인 경우, u + v(1번부터 재귀) 반환 3-3. u가 올바른 문자열이 아닌 경우, 문제의 4번 과정 수행 (recursive 함수..
[Codility] Lesson4. FrogRiverone (C++)
·
코딩 테스트
🔮문제 A small frog wants to get to the other side of a river. The frog is initially located on one bank of the river (position 0) and wants to get to the opposite bank (position X+1). Leaves fall from a tree onto the surface of the river. You are given an array A consisting of N integers representing the falling leaves. A[K] represents the position where one leaf falls at time K, measured in secon..
[Codility] Lesson1. BinaryGap (C++)
·
코딩 테스트
🔮문제 A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has bina..