Why last step g.addEdge(36,36)

my query is why we need to add this step, it is required that i can see from the result but why?

what two for loops are doing they are basically making connections(unidirectional) in the graph, like joining 4-10,1-5, and so on but likewise when we reach 30 , by throwing 6 we are reaching to 36 and this connection is actually establishing when i=30 and j=36 as box =0 why then we have to make connection explicitly

yes only connection stabiles but not a node 36 added
we have nodes only till 35
so we have to add node 36 explicitly

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.