How would you optimize a search algorithm for a massive dataset with high latency?
Implement a two-level search over ordered, non-empty sorted shards. First identify the only shard that could contain target, then binary-search within that shard. Return the shard and element indices, or [-1, -1] when the value is absent.
Function: search_shards(shards, target). shards is a list of sorted integer lists whose value ranges do not overlap and are ordered by value.
def search_shards(shards, target):