Algorithm(16)
-
[leetcode] 509. Fibonacci Number
- 이전 블로그에서 2020. 7. 6. 에 본인이 직접 작성한 포스트를 옮겨온 글입니다. 출처: https://june13.tistory.com/12?category=873278 [Made for More] 1. 문제분석 https://leetcode.com/problems/fibonacci-number/ Fibonacci Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 난이도 : easy Note: 0 ≤ N ≤ 30. 피보나치 수열 문제이다...
2021.09.05 -
[leetcode] 27. Remove element
- 이전 블로그에서 2020. 7. 3. 에 본인이 직접 작성한 포스트를 옮겨온 글입니다. 출처: https://june13.tistory.com/10?category=873278 [Made for More] 1. 문제분석 https://leetcode.com/problems/remove-element/description/ Remove Element - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 난이도 : easy 간단히 nums 라는 array와 val이..
2021.09.05 -
[algorithm] 2018 Kakao Blind Recruitment 1차 - 다트게임
1. 문제분석 https://programmers.co.kr/learn/courses/30/lessons/17682 코딩테스트 연습 - [1차] 다트 게임 programmers.co.kr 3번의 기회가 주어지는 다트게임에서 한번의 기회당 점수 / 보너스 /옵션 이 주어진다. Input "점수|보너스|[옵션]"으로 이루어진 문자열 3세트. 예) 1S2D*3T 점수 : 0~10 사이 정수 보너스 : S (1제곱) , D(2제곱) , T(3제곱) 옵션 : * (이번판과 그 전판의 점수를 *2 ) , # ( 이번 판의 점수에 *(-1) ) , 옵션없음 문제는 간단하지만 input 문자열을 잘 처리하는것이 핵심이다. 정규표현식을 써서 분리를 할수도 있겠지만 직관적으로 앞에서부터 잘라가는 방식이 빠르게 풀이하기에는..
2021.08.29 -
[algorithm] 2018 Kakao Blind Recruitment 1차 - 비밀지도
1. 문제분석 https://programmers.co.kr/learn/courses/30/lessons/17681 코딩테스트 연습 - [1차] 비밀지도 비밀지도 네오는 평소 프로도가 비상금을 숨겨놓는 장소를 알려줄 비밀지도를 손에 넣었다. 그런데 이 비밀지도는 숫자로 암호화되어 있어 위치를 확인하기 위해서는 암호를 해독해야 한다. 다 programmers.co.kr 문제는 간단한 2진법 문제이다. 2. 풀이 1) 2진법으로 변환하여 1과 0으로 된 지도를 만든다. (2개의 지도) 2) 좌표를 하나씩 탐색하며 두 지도는 합친 지도를 만든다. def solution(n, arr1, arr2): arr1_bin=[] arr2_bin=[] for x,y in zip(arr1,arr2): a =bin(x)[2:..
2021.08.28