88
99<!-- problem:start -->
1010
11- # [ 3475. DNA Pattern Recognition ] ( https://leetcode.cn/problems/dna-pattern-recognition )
11+ # [ 3475. DNA 模式识别 ] ( https://leetcode.cn/problems/dna-pattern-recognition )
1212
1313[ English Version] ( /solution/3400-3499/3475.DNA%20Pattern%20Recognition/README_EN.md )
1414
1515## 题目描述
1616
1717<!-- description:start -->
1818
19- <p >Table: <code >Samples</code ></p >
19+ <p >表: <code >Samples</code ></p >
2020
2121<pre >
2222+----------------+---------+
@@ -26,30 +26,31 @@ tags:
2626| dna_sequence | varchar |
2727| species | varchar |
2828+----------------+---------+
29- sample_id is the unique key for this table.
30- Each row contains a DNA sequence represented as a string of characters (A, T, G, C) and the species it was collected from.
29+ sample_id 是这张表的唯一主键。
30+ 每一行包含一个 DNA 序列以一个字符(A,T,G,C)组成的字符串表示以及它所采集自的物种。
3131</pre >
3232
33- <p >Biologists are studying basic patterns in DNA sequences. Write a solution to identify <code >sample_id</code > with the following patterns: </p >
33+ <p >生物学家正在研究 DNA 序列中的基本模式。编写一个解决方案以识别具有以下模式的 & nbsp ; <code >sample_id</code >: </p >
3434
3535<ul >
36- <li>Sequences that <strong>start </strong> with <strong>ATG </strong> (a common <strong>start codon </strong>) </li>
37- <li>Sequences that <strong>end</strong> with either <strong> TAA</strong>, <strong>TAG</strong>, or <strong>TGA</strong> ( <strong>stop codons </strong>) </li>
38- <li>Sequences containing the motif <strong>ATAT</strong> (a simple repeated pattern) </li>
39- <li>Sequences that have <strong>at least </strong> <code>3</code> <strong>consecutive </strong> <strong>G</strong> (like <strong>GGG</strong> or <strong>GGGG</strong>) </li>
36+ <li>以 <strong>ATG </strong> <strong>开头 </strong> 的序列(一个常见的 <strong>起始密码子 </strong>) </li>
37+ <li>以 <strong>TAA</strong>, <strong>TAG</strong> 或 <strong>TGA</strong> <strong>结尾 </strong> 的序列(终止密码子) </li>
38+ <li>包含基序 <strong>ATAT</strong> 的序列(一个简单重复模式) </li>
39+ <li>有 <strong>至少 </strong> <code>3</code> <strong>个连续 </strong> <strong>G</strong> 的序列(如 <strong>GGG</strong> 或 <strong>GGGG</strong>) </li>
4040</ul >
4141
42- <p >Return < em >the result table ordered by   ; </ em >< em > sample_id in <strong >ascending </strong > order< /em >. </p >
42+ <p >返回结果表以   ; sample_id <strong >升序 </strong >& nbsp ; 排序< em >。< /em ></p >
4343
44- <p >The result format is in the following example. </p >
44+ <p >结果格式如下所示。 </p >
4545
4646<p >  ; </p >
47- <p ><strong class =" example " >Example:</strong ></p >
47+
48+ <p ><strong class =" example " >示例:</strong ></p >
4849
4950<div class =" example-block " >
50- <p ><strong >Input: </strong ></p >
51+ <p ><strong >输入: </strong ></p >
5152
52- <p >Samples table: </p >
53+ <p >Samples 表: </p >
5354
5455<pre class =" example-io " >
5556+-----------+------------------+-----------+
@@ -65,7 +66,7 @@ Each row contains a DNA sequence represented as a string of characters (A, T, G,
6566+-----------+------------------+-----------+
6667</pre >
6768
68- <p ><strong >Output: </strong ></p >
69+ <p ><strong >输出: </strong ></p >
6970
7071<pre class =" example-io " >
7172+-----------+------------------+-------------+-------------+------------+------------+------------+
@@ -81,69 +82,69 @@ Each row contains a DNA sequence represented as a string of characters (A, T, G,
8182+-----------+------------------+-------------+-------------+------------+------------+------------+
8283</pre >
8384
84- <p ><strong >Explanation: </strong ></p >
85+ <p ><strong >解释: </strong ></p >
8586
8687<ul >
87- <li>Sample 1 ( ATGCTAGCTAGCTAA):
88+ <li>样本 1( ATGCTAGCTAGCTAA):
8889 <ul>
89- <li>Starts with ATG ( has_start = 1) </li>
90- <li>Ends with TAA ( has_stop = 1) </li>
91- <li>Does not contain ATAT ( has_atat = 0) </li>
92- <li>Does not contain at least 3 consecutive 'G's ( has_ggg = 0) </li>
90+ <li>以 ATG 开头( has_start = 1) </li>
91+ <li>以 TAA 结尾( has_stop = 1) </li>
92+ <li>不包含 ATAT( has_atat = 0) </li>
93+ <li>不包含至少 3 个连续 ‘G’( has_ggg = 0) </li>
9394 </ul>
9495 </li>
95- <li>Sample 2 ( GGGTCAATCATC):
96+ <li>样本 2( GGGTCAATCATC):
9697 <ul>
97- <li>Does not start with ATG ( has_start = 0) </li>
98- <li>Does not end with TAA, TAG, or TGA ( has_stop = 0) </li>
99- <li>Does not contain ATAT ( has_atat = 0) </li>
100- <li>Contains GGG ( has_ggg = 1) </li>
98+ <li>不以 ATG 开头( has_start = 0) </li>
99+ <li>不以 TAA, TAG 或 TGA 结尾( has_stop = 0) </li>
100+ <li>不包含 ATAT( has_atat = 0) </li>
101+ <li>包含 GGG( has_ggg = 1) </li>
101102 </ul>
102103 </li>
103- <li>Sample 3 ( ATATATCGTAGCTA):
104+ <li>样本 3( ATATATCGTAGCTA):
104105 <ul>
105- <li>Does not start with ATG ( has_start = 0) </li>
106- <li>Does not end with TAA, TAG, or TGA ( has_stop = 0) </li>
107- <li>Contains ATAT ( has_atat = 1) </li>
108- <li>Does not contain at least 3 consecutive 'G's ( has_ggg = 0) </li>
106+ <li>不以 ATG 开头( has_start = 0) </li>
107+ <li>不以 TAA, TAG 或 TGA 结尾( has_stop = 0) </li>
108+ <li>包含 ATAT( has_atat = 1) </li>
109+ <li>不包含至少 3 个连续 ‘G’( has_ggg = 0) </li>
109110 </ul>
110111 </li>
111- <li>Sample 4 ( ATGGGGTCATCATAA):
112+ <li>样本 4( ATGGGGTCATCATAA):
112113 <ul>
113- <li>Starts with ATG ( has_start = 1) </li>
114- <li>Ends with TAA ( has_stop = 1) </li>
115- <li>Does not contain ATAT ( has_atat = 0) </li>
116- <li>Contains GGGG ( has_ggg = 1) </li>
114+ <li>以 ATG 开头( has_start = 1) </li>
115+ <li>以 TAA 结尾( has_stop = 1) </li>
116+ <li>不包含 ATAT( has_atat = 0) </li>
117+ <li>包含 GGGG( has_ggg = 1) </li>
117118 </ul>
118119 </li>
119- <li>Sample 5 ( TCAGTCAGTCAG):
120+ <li>样本 5( TCAGTCAGTCAG):
120121 <ul>
121- <li>Does not match any patterns (all fields = 0) </li>
122+ <li>不匹配任何模式(所有字段 = 0) </li>
122123 </ul>
123124 </li>
124- <li>Sample 6 ( ATATCGCGCTAG):
125+ <li>样本 6( ATATCGCGCTAG):
125126 <ul>
126- <li>Does not start with ATG ( has_start = 0) </li>
127- <li>Ends with TAG ( has_stop = 1) </li>
128- <li>Starts with ATAT ( has_atat = 1) </li>
129- <li>Does not contain at least 3 consecutive 'G's ( has_ggg = 0) </li>
127+ <li>不以 ATG 开头( has_start = 0) </li>
128+ <li>以 TAG 结尾( has_stop = 1) </li>
129+ <li>包含 ATAT( has_atat = 1) </li>
130+ <li>不包含至少 3 个连续 ‘G’( has_ggg = 0) </li>
130131 </ul>
131132 </li>
132- <li>Sample 7 ( CGTATGCGTCGTA):
133+ <li>样本 7( CGTATGCGTCGTA):
133134 <ul>
134- <li>Does not start with ATG ( has_start = 0) </li>
135- <li>Does not end with TAA, " TAG", or " TGA" ( has_stop = 0) </li>
136- <li>Does not contain ATAT ( has_atat = 0) </li>
137- <li>Does not contain at least 3 consecutive 'G's ( has_ggg = 0) </li>
135+ <li>不以 ATG 开头( has_start = 0) </li>
136+ <li>不以 TAA, TAG 或 TGA 结尾( has_stop = 0) </li>
137+ <li>不包含 ATAT( has_atat = 0) </li>
138+ <li>不包含至少 3 个连续 ‘G’( has_ggg = 0) </li>
138139 </ul>
139140 </li>
140141</ul >
141142
142- <p ><strong >Note: </strong ></p >
143+ <p ><strong >注意: </strong ></p >
143144
144145<ul >
145- <li>The result is ordered by sample_id in ascending order </li>
146- <li>For each pattern, 1 indicates the pattern is present and 0 indicates it is not present </li>
146+ <li>结果以 sample_id 升序排序 </li>
147+ <li>对于每个模式,1 表示该模式存在,0 表示不存在 </li>
147148</ul >
148149</div >
149150
0 commit comments