'Retrieve the 10 most recent tweet ids in the user\'s news feed. Each item in the news feed must be posted by users who the user followed or by the user herself. Tweets must be ordered from most recent to least recent.
:type userId: int
:rtype: List[int]'

def getNewsFeed(self, userId):

    max_heap = []
    if self.__messages[userId]:
        heapq.heappush(max_heap, ((- self.__messages[userId][(-1)][0]), userId, 0))
    for uid in self.__followings[userId]:
        if self.__messages[uid]:
            heapq.heappush(max_heap, ((- self.__messages[uid][(-1)][0]), uid, 0))
    result = []
    while (max_heap and (len(result) < self.__number_of_most_recent_tweets)):
        (t, uid, curr) = heapq.heappop(max_heap)
        nxt = (curr + 1)
        if (nxt != len(self.__messages[uid])):
            heapq.heappush(max_heap, ((- self.__messages[uid][(- (nxt + 1))][0]), uid, nxt))
        result.append(self.__messages[uid][(- (curr + 1))][1])
    return result
