
문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(dots): answer = 0 if gradient(dots[0], dots[1]) == gradient(dots[2], dots[3]) or gradient(dots[0], dots[2]) == gradient(dots[1], dots[3]) or gradient(dots[0], dots[3]) == gradient(dots[1], dots[2]): answer = 1 return answer def gradient(a, b): return (a[1]-b[1])..

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(board): temp = [[0 for _ in range(len(board) + 2)] for _ in range(len(board) + 2)] for i in range(len(board)): for j in range(len(board)): temp[i+1][j+1] = board[i][j] answer = 0 for i in range(len(board)): for j in range(len(board)): check = 0 for p in range(3)..

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(quiz): answer = [] for fomula in quiz: part = fomula.split(' ') if cal(*part[0:3]) == int(part[4]): answer.["O"] else: answer.["X"] return answer def cal(n, operator, m): if operator = "+": return int(n) + int(m) elif operator = "-": return int(n) - int(m) *key ..

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(numbers): numbers_list = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] for num, num_en in enumerate(numbers_list): numbers = str(num).join(numbers.split(num_en)) answer = int(numbers) return answer *key point: 영어로 표기된 각 숫자를 리스트..

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(keyinput, board): direction = {'left':(-1,0), 'right':(1,0), 'up':(0,1), 'down':(0,-1) } answer = [0, 0] for key in keyinput: dx, dy = direction[key] if abs(answer[0] + dx) > board[0]//2 or abs(answer[1] + dy) > board[1]//2: continue else: answer[0] += dx answer..

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(n, numlist): answer = [num for num in numlist if num % n == 0] return answer *key point: list comprehension을 활용하면 문제 조건을 쉽게 구현할 수 있다.

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(id_pw, db): if id_pw in db: return "login" for data in db: if data[0] == id_pw[0]: return "wrong pw" return "fail" *key point: if문과 for문을 적절히 활용하여 주어진 조건에 따라 적합한 return 값을 가지도록 한다.

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(order): order_list = list(str(order)) answer = order_list.count('3') + order_list.count('6') + order_list.count('9') return answer *key point: 자료형 변환을 통해 리스트로 만들어 count 메서드로 3, 6, 9의 개수를 세어준다.

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 import math def solution(price): if price >= 500000: discount = 0.2 elif price >= 300000: discount = 0.1 elif price >= 100000: discount = 0.05 else: discount = 0 answer = math.floor(price * (1 - discount)) return answer *key point: if문을 활용한다. math 라이브러리를 통해 소수점 이하를 버린다.

문제 링크 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 풀이 def solution(angle): if angle > 0 and angle < 90: answer = 1 elif angle == 90: answer = 2 elif angle < 180: answer = 3 else: answer = 4 return answer *key point: if문을 활용한다.
- Total
- Today
- Yesterday
- programmer
- 13241
- MySQL
- Python
- 2903
- 24060
- Wil
- 항해 플러스
- SQL
- 백준
- 25501
- 2587
- 코육대
- til
- 항해+
- Programmers
- 24723
- 26069
- 25192
- 1269
- 4134
- 2738
- 5597
- 2053
- 벡준
- 13909
- 24313
- 10807
- 17103
- 20920
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |