Skip to content

Instantly share code, notes, and snippets.

View otto-schnurr's full-sized avatar

Otto Schnurr otto-schnurr

View GitHub Profile
#!/usr/bin/xcrun swift -F .
// FileInput module from https://github.com/otto-schnurr/FileInput-swift
import FileInput
let dna = input().nextLine()!
var count: [Character: Int] = ["A": 0, "C": 0, "G": 0, "T": 0];
for base in dna { count[base]? += 1 }
println(" ".join(map("ACGT") { toString(count[$0]!) }))