Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- 파이썬
- ubuntu
- Baekjoon
- 맥북
- hackerrank
- 자연어처리
- 편스토랑
- AI 경진대회
- 더현대서울 맛집
- Docker
- 캐치카페
- ChatGPT
- Kaggle
- 우분투
- 코로나19
- Real or Not? NLP with Disaster Tweets
- 데이콘
- 프로그래머스 파이썬
- SW Expert Academy
- 백준
- Git
- leetcode
- 프로그래머스
- PYTHON
- dacon
- 금융문자분석경진대회
- programmers
- 편스토랑 우승상품
- github
- gs25
Archives
- Today
- Total
솜씨좋은장씨
[Programmers] 2022 KAKAO TECH INTERNSHIP - 성격 유형 검사하기 (Python) 본문
Programming/코딩 1일 1문제
[Programmers] 2022 KAKAO TECH INTERNSHIP - 성격 유형 검사하기 (Python)
솜씨좋은장씨 2022. 8. 30. 12:47728x90
반응형

코딩 1일 1문제! 오늘의 문제는 프로그래머스의 2022 KAKAO TECH INTERNSHIP 성격 유형 검사 하기 입니다.
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
👨🏻💻 코드 ( Solution )
def get_character_score(question, choice, score_list):
if 1 <= choice <= 4:
character_type = question[0]
score = score_list[choice-1]
elif 5 <= choice <= 7:
character_type = question[1]
score = score_list[choice-1]
return character_type, score
def get_high_score_character(score_dict, character1, character2):
if score_dict[character1] > score_dict[character2]:
high_score_character = character1
elif score_dict[character1] < score_dict[character2]:
high_score_character = character2
else:
high_score_character = min(character1, character2)
return high_score_character
def make_character_type_string(score_dict):
character_type_string = ""
character_list = [
("R", "T"), ("C", "F"), ("J", "M"), ("A", "N")
]
for character in character_list:
high_score_character = get_high_score_character(
score_dict=score_dict,
character1=character[0], character2=character[1]
)
character_type_string += high_score_character
return character_type_string
def solution(survey, choices):
character_type_score_dict = {
"R": 0, "T": 0, "C": 0, "F": 0,
"J": 0, "M": 0, "A": 0, "N": 0
}
score_list = [3, 2, 1, 0, 1, 2, 3]
for question, choice in zip(survey, choices):
character_type, score = get_character_score(
question=question, choice=choice, score_list=score_list
)
character_type_score_dict[character_type] += score
return make_character_type_string(score_dict=character_type_score_dict)
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 5361번 : 전투 드로이드 가격 (Pyhton) (0) | 2022.09.01 |
---|---|
[BaekJoon] 1718번 : 암호 (Python) (0) | 2022.08.30 |
[BaekJoon] 1837번 : 암호제작 (Python) (0) | 2022.08.29 |
[BaekJoon] 23825번 : SASA 모형을 만들어보자 (Python) (0) | 2022.08.29 |
[BaekJoon] 2999번 : 비밀 이메일 (Python) (0) | 2022.08.25 |