Skip to content

Instantly share code, notes, and snippets.

View jai-dewani's full-sized avatar

Jai Kumar Dewani jai-dewani

View GitHub Profile
@jai-dewani
jai-dewani / pride_flag.py
Last active February 6, 2023 18:11
A python script that created a pride flag using turtle
from turtle import *
colors = ["red","orange","yellow","green","blue","purple"]
def move(x):
forward(x)
right(90)
def strip():
pendown()
begin_fill()
@jai-dewani
jai-dewani / shuffleClass.py
Last active May 17, 2021 03:20
Apex College Shifting Array Problem
import math
def shuffleClass(array,index):
n = len(array)
if type(array)==type([]):
if array==[]:
return []
else:
index = index % n
gcd = math.gcd(index,n)
for i in range(gcd):
@jai-dewani
jai-dewani / CF_round.sh
Created July 24, 2020 16:21
A bash script to create a folder with python files a template code in each one and open this folder with VScode
# I found myself creating folders for each round and writing the same template again and again taking precious time in a CF contest
# so I create a script file that does the work for me within seconds
echo -n "Round Name:"
read round
mkdir $round
template="for _ in range(int(input())):
n = int(input())
s = input()