일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 이더리움
- mac hive 3
- mac hadoop 설치
- 기업 조사 빨리 하는 법
- 자소서 빨리 쓰는 법
- mac hadoop 설정
- 자소서 빨리
- hive beeline 에러
- hive beeline
- 자소서 너무 오래 걸림
- mac hadoop 3
- mac hadoop
- Safe mode is ON
- 카카오 2020 코딩테스트
- hadoop safe mode
- code=0)
- 백준 18428
- 자소서 시간 줄이기
- Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000
- Resources are low on NN
- is not allowed to impersonate hive (state=08S01
- hive beeline 실행
- 카카오 자물쇠와 열쇠
- 카카오 2020 코테
- 도커 교과서
- Failed to connect to localhost:10000
- 이더리움 #ethereum
- hive beeline 설정
- mac hive
- hadoop safe mode leave
Archives
- Today
- Total
A seeker after truth
exercism RNA-transcription solution 본문
P)
Given a DNA strand, return its RNA complement (per RNA transcription).
Both DNA and RNA strands are a sequence of nucleotides.
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**),
guanine (**G**) and thymine (**T**).
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**),
guanine (**G**) and uracil (**U**).
Given a DNA strand, its transcribed RNA strand is formed by replacing
each nucleotide with its complement:
* `G` -> `C`
* `C` -> `G`
* `T` -> `A`
* `A` -> `U`
sol1)
def to_rna(text):
# get이란 함수가 있는지 몰랐는데, 파라미터로 key 이름 받으면 value를 get한다.
rna = ''.join(map(lambda char: {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}.get(char, ''), text))
return rna if len(rna) == len(text) else ''
sol2)
def to_rna(dna):
dna_to_rna = {'A':'U','T':'A','C':'G','G':'C'}
return ''.join(dna_to_rna[i] for i in dna)
'Algorithm > 문제풀이' 카테고리의 다른 글
프로그래머스 정렬 문제(2) (작성중) (0) | 2020.01.25 |
---|---|
exercism raindrops solution (0) | 2020.01.24 |
exercism pangram solution (0) | 2020.01.24 |
exercism leap solution (0) | 2020.01.24 |
exercism reverse-string solution (0) | 2020.01.24 |