[자바스크립트로 구현한 알고리즘] Complementary DNA

남양주개발자

·

2016. 9. 17. 19:12

728x90
반응형



Description: 

Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and functioning of living organisms. 

If you want to know more http://en.wikipedia.org/wiki/DNA In DNA strings, symbols "A" and "T" are complements of each other, as "C" and "G". 


You have function with one side of the DNA (string, except for Haskell); 

you need to get the other complementary side. 

DNA strand is never empty or there is no DNA at all (again, except for Haskell). 

DNAStrand ("ATTGC") # return "TAACG" DNAStrand ("GTAT") # return "CATA"



코드가 약간 반복적이게 이쁘지 않은 코드가 나온 느낌이 듭니다.


좀 더 개선된 코드로 이 알고리즘을 개선해 보겠습니다.



728x90
반응형
그리드형

💖 저자에게 암호화폐로 후원하기 💖

아이콘을 클릭하면 지갑 주소가자동으로 복사됩니다