DNA, codons, proteins
Viagra :) Jezik nebitan. Zna li neko?
Given a string representing DNA, return a list of strings each representing one of the proteins coded for by the DNA. (Some details of DNA and protein are ignored here, you should ignore them too) DNA is represented as a string whose characters are all in the set [ACGT]. Proteins are represented as a string whose characters are all in the set [GAVLIMFWPSTCYNQDEKRH]. Three adjacent characters in DNA represent a codon. DNA is read one codon at a time and translated into protein. Reading starts with a start codon and stops at a stop codon. There is one start codon, ATG, which also codes for the protein M (which means for the purposes of these problems that all proteins begin with M). ATG only acts as a start codon if it is not in between another start/stop codon pair. There are three stop codons, TAA, TAG, and TGA. These do not code for a character in the resulting protein, they simply terminate the protein. For example, here is a short sequence of DNA: ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGATCGA TGGCGCTACGCATAATATAAAAA It is translated as follows: (junk) M V H L T L I STOP (junk) M R S M A L R I I STOP (junk) ACCTCCAAC-ATG-GTG-CAC-CTG-ACT-CTC-ATT-TGA-GATATAAAAAAACC-ATG-AGA-TCG-ATG-GCG-CTA-CGC-ATA-ATA-TAA-AAAAGGCCA So given the above protein as input your program should return: MVHLTLI MRSMALRII IN Citat:
Citat:
|
Mislim da nije dobar primer, ja dobijem:
MVHLTLI MRAMALRII PHP kôd:
|
Ja dobijam
Kôd:
["MVHLTLI", "MRSMALRII"] ili npr (malo zvirnuo kod ivanhoe) ;) http://ideone.com/EGDPN |
aha, ja sam greskom obrisao onaj spejs u DNA
EDIT: Zapravo nije nista pogresno, nisam pazljivo citao, pa i treba da se dobije MRAMALRII za zadati input... |
Primljeni ste :D
Ja sam napravio glupu grešku što nisam čitao sa pažnjom, a kasnije je bilo kasno pošto je vremenski ograničeno, i unosi idu preko STDIN itd... MVHL MRAMALRI P.S. nema spacea, to je greška kako sam postovao. PHP kôd:
|
a za sta je ovo pitanje?
|
Facebook... evo email, možete kontaktirati i dobićete šansu, standardna procedura, bWxhbmdhbkBmYi5jb20= ... Na intervju za PHP, pitaju za šta služi strstr i tako, zadatak je bitan :)
|
Vreme je GMT +2. Trenutno vreme je 01:40. |
Powered by vBulletin® Verzija 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © DevProTalk. All Rights Reserved.