




'''simple docstring'''







def 		snake_case_							(_a			:							List[str]  ):
    UpperCAmelCase     =	[0] * len(_a  )
    UpperCAmelCase     =	[]
    UpperCAmelCase     =	[1] * len(_a  )

    for values in graph.values():
        for i in values:
            indegree[i] += 1

    for i in range(len(_a  )  ):
        if indegree[i] == 0:
            queue.append(_a  )

    while queue:
        UpperCAmelCase     =	queue.pop(0  )
        for x in graph[vertex]:
            indegree[x] -= 1

            if long_dist[vertex] + 1 > long_dist[x]:
                UpperCAmelCase     =	long_dist[vertex] + 1

            if indegree[x] == 0:
                queue.append(_a  )

    print(max(_a  )  )


# Adjacency list of Graph
A									={0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}







longest_distance(graph)










'''simple docstring'''







from __future__ import annotations

import requests





def 		snake_case_							(_a			:							str  ):
    UpperCAmelCase     =	F"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
    return requests.get(_a  ).json()





def 		snake_case_							(_a			:							int = 1_0  ):
    UpperCAmelCase     =	'''https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'''
    UpperCAmelCase     =	requests.get(_a  ).json()[:max_stories]
    return [get_hackernews_story(_a  ) for story_id in story_ids]





def 		snake_case_							(_a			:							int = 1_0  ):
    UpperCAmelCase     =	hackernews_top_stories(_a  )
    return "\n".join('''* [{title}]({url})'''.format(**_a  ) for story in stories  )


if __name__ == "__main__":
   print(hackernews_top_stories_as_markdown())




