This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]!) })) |
NewerOlder