Skip to content

Instantly share code, notes, and snippets.

def find_largest_sum_cycle(n, edges):
def dfs(node, visited, stack, path_sum, cycle_sums):
visited[node] = True
stack[node] = path_sum
next_node = edges[node]
if next_node != -1:
if not visited[next_node]:
dfs(next_node, visited, stack, path_sum + next_node, cycle_sums)
elif stack[next_node] != -1:
@rishabhgargg
rishabhgargg / airflow-values.yaml
Created October 31, 2023 17:43
airflow-values.yaml
fullnameOverride: ""
nameOverride: ""
useStandardNaming: true
revisionHistoryLimit: ~
uid: 50000
gid: 0
securityContext: {}
securityContexts:
pod: {}
containers: {}
@rishabhgargg
rishabhgargg / gist:dc90efc36e37a687915321289433aa1e
Last active November 7, 2023 18:12
Remove all comments from VS code yaml

^\s*#.*$

@rishabhgargg
rishabhgargg / gist:a88dac2788cb75526a7a5fd70ec04a14
Created October 28, 2023 09:21
List containers with containerd CRI
ctr ns ls ------ To list namespaces
ctr -n k8s.io containers list
@rishabhgargg
rishabhgargg / code.c
Created October 11, 2023 15:00
Raghav 1
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector state(N);
vector distance(N);
@rishabhgargg
rishabhgargg / code.c
Created October 11, 2023 14:43
scaler
#include<stdio.h>
int main()
{
int cnt,j,n,t,remain,flag=0,tq;
int wt=0,tat=0,at[10],bt[10],rt[10];
printf("Enter Total Process:\t ");
scanf("%d",&n);
remain=n;
#include<stdio.h>
int waitingtimerobin(int * job, int * run, int n, int tq)
{
int j, count, time, remain, flag = 0;
int wait_time = 0, turnaround_time = 0, rt[10];
remain = n;
for (count = 0; count < n; c++)
{
rt[count] = run[count];
}
#include <bits/stdc++.h>
#define ll long long
#define vll vector<long long>
#define vii vector<int>
#define vpi vector<pair<int,int> >
#define vpl vector<pair<ll,ll> >
#define pb push_back
#define mp make_pair
#define fi first
#define se second