Skip to content

Instantly share code, notes, and snippets.

View alaz's full-sized avatar

Alexander Azarov alaz

View GitHub Profile
def radixSort(arr: Seq[Int]): Seq[Int] = {
def fn(state: Seq[Int], d: Int): Seq[Int] = {
val ten_power_d = Iterator.fill(d)(10).product
val buckets = state.groupBy(_ / ten_power_d % 10).toMap
buckets.keys.toSeq.sorted.foldLeft(Seq.empty[Int]) { case (acc, i) =>
acc ++ buckets(i)
}
}
val digits = Iterator.iterate(arr) {
us.rdx2.lgtvsdp.com
us.info.lgsmartad.com
us.ibs.lgappstv.com
us.lgtvsdp.com
ad.lgappstv.com
smartshare.lgtvsdp.com
ibis.lgappstv.com
# added after fork
# from https://www.reddit.com/r/pihole/comments/6qmpv6/blacklists_for_lg_webos_tvs/ and others