Skip to content

Instantly share code, notes, and snippets.

View devpruthvi's full-sized avatar
🎯
Focusing

Pruthvi Raj devpruthvi

🎯
Focusing
View GitHub Profile
sets = [ [0], #see this dummy set it is important, this is set_0
#because initially we add -arr[0] or arr[0] to 0
[10,-10],
[30,-10,10,-30],
[100,20,40,-40,60,-20,-80,0,-60,-100],
[60,0,20,-40,-20,-60]]
# my array is 1 based so ignore the zero
arr = [0,10,20,40,30]
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from matplotlib import animation
import matplotlib.patches as patches
import math
global_R = 0
import heapq
import math
numTests = int(input())+1
def getminind(l):
return heapq.nsmallest(1, ((k, i) for i, k in enumerate(l)))[0][1]
import networkx as nx
import matplotlib.pyplot as plt
class Vertex:
def __init__(self, node):
self.id = node
self.adjacent = {}