Skip to content

Instantly share code, notes, and snippets.

View thecodearrow's full-sized avatar
🎯
Focusing

Prashanth Vaidya thecodearrow

🎯
Focusing
View GitHub Profile
from collections import defaultdict
class Graph:
def __init__(self):
self.neighbours=defaultdict(list)
def addEdge(self,u,v):
self.neighbours[u].append(v)
self.neighbours[v].append(u)
# EDGE CASES THAT FAILED during contest N=1;K=1;K=2;K=3 FIXED!
t=int(input())
while(t!=0):
t-=1
n,k=[int(x) for x in input().split()]
count=n