From 1c26ae7b866771a9963034c9e90dfac387ffbecc Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Tue, 11 Aug 2026 20:32:37 -0400 Subject: [PATCH] Add the in-progress exercise --- notes-and-examples/2026.08.11/exercise1.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/notes-and-examples/2026.08.11/exercise1.py b/notes-and-examples/2026.08.11/exercise1.py index bf24475..5a079c0 100644 --- a/notes-and-examples/2026.08.11/exercise1.py +++ b/notes-and-examples/2026.08.11/exercise1.py @@ -13,16 +13,32 @@ sample_graph = { 'Mallory': set(['Carol', 'Grace']) } +# This is an in-progress exercise + def nth_degree_connections( graph: dict[str, set[str]], starting_vertex: str, max_n: int ): - # TODO - pass + checkinglist=[[starting_vertex,0]] + listvisited=list() + x=[0,0] + while len(listvisited)!=len(graph) and checkinglist!=[] and x[1]