Skip to content

Instantly share code, notes, and snippets.

def maxShared(friendsNodes: Int, friendsFrom: Array[Int], friendsTo: Array[Int], friendsWeight: Array[Int]): Int = {
val allNodesFrom = friendsFrom ++ friendsTo
val allWeights = friendsWeight ++ friendsWeight
val allNodesTo = friendsTo ++ friendsFrom
val nodeToNodeOverInterest = allNodesFrom
.zipWithIndex
.foldLeft(Map[Int, Map[Int, Set[Int]]]())((acc, p) => {
@sparlampe
sparlampe / gist:5b9dc019a62db8a19941f6526e39dff1
Last active May 8, 2018 21:24
OVMF passthrough of RX570 over Thunderbolt3 on Thinkpad P50
prompt:/# kvm -version
QEMU emulator version 2.9.0 (v2.9.0-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
prompt:/# uname -a
Linux ThinkPad-P50 4.13.8-041308-generic #201710180430 SMP Wed Oct 18 08:33:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux