Solve a few problems
This commit is contained in:
commit
59de67963d
14 changed files with 101 additions and 0 deletions
11
01_dna/dna.nim
Normal file
11
01_dna/dna.nim
Normal file
|
@ -0,0 +1,11 @@
|
|||
import std/strformat
|
||||
import std/tables
|
||||
|
||||
var baseCounts = {'A': 0, 'C': 0, 'G': 0, 'T': 0}.toTable
|
||||
var dnaString = readFile("rosalind_dna.txt")
|
||||
|
||||
for c in items(dnaString):
|
||||
if c in baseCounts:
|
||||
inc(baseCounts[c])
|
||||
|
||||
echo fmt"{baseCounts['A']} {baseCounts['C']} {baseCounts['G']} {baseCounts['T']}"
|
Loading…
Add table
Add a link
Reference in a new issue