Skip to content

Instantly share code, notes, and snippets.

View atul-chaudhary's full-sized avatar
🎯
Focusing

Atul Chaudhary atul-chaudhary

🎯
Focusing
View GitHub Profile
@atul-chaudhary
atul-chaudhary / program1.py
Created September 8, 2019 05:50
Valid parenthesis check program
#to check wheather the given parenthesis are valid or not implementation is done using stack
pat = '[({()})[]}'
lst = []
srt_pat = ['{', '(', '[']
cls_pat = ['}', ')', ']']
chec_lst=['{}','()','[]']
for i in range(len(pat)):
if (pat[i] in srt_pat):
lst.append(pat[i])
else:
@atul-chaudhary
atul-chaudhary / program.py
Created September 8, 2019 03:07
Print matrix in spiral
a = [[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18]]
int_row = 0
last_row = 3
int_col = 0
last_col = 6
while(int_row<=last_row and int_col<=last_col):
@atul-chaudhary
atul-chaudhary / program.py
Created September 8, 2019 03:07
Print matrix in spiral
a = [[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18]]
int_row = 0
last_row = 3
int_col = 0
last_col = 6
while(int_row<=last_row and int_col<=last_col):
@atul-chaudhary
atul-chaudhary / pattern6.py
Created September 4, 2019 05:10
HOTS: pattern program
enter the height=3
enter the width=3
enter the number of stairs=3
@@@ @@@
@@ @@
@ @
@@@ @@@
@@ @@
@ @
@@@ @@@
@atul-chaudhary
atul-chaudhary / pattern5.py
Created September 4, 2019 04:46
HOTS: pattern programs
enter the height=3
enter the width=3
enter the number of stairs=3
@@@
@@
@
@@@
@@
@
@@@
@atul-chaudhary
atul-chaudhary / pattern4.py
Created September 4, 2019 03:07
HOTS: pattern program
pattern runs for both odd and even number starting from n==3
n==3
* * * * *
* * *
* * * *
* * * * *
n==4
* * * * * *
* * *
* * * *
@atul-chaudhary
atul-chaudhary / pattern3.py
Created September 4, 2019 02:54
HOTS : Pattern program
#pattern run for only off number like ->3,5,7,9,11 etc
#n==3
***********
* | *
* * *
*---***---*
#for n==5
*****************
* | *
@atul-chaudhary
atul-chaudhary / pattern2.py
Created September 3, 2019 11:54
HOTS: pattern program
#for n==9
* * *
* *** *
* ***** *
* ******* *
*---------*********---------*
* ******* *
* ***** *
* *** *
* * *
@atul-chaudhary
atul-chaudhary / pattern1.pyt
Created September 1, 2019 12:52
Grapecity: pattern program placement test hiring
#only runs for 1,3 and 5
#pattern is
#n==5
1
232
34543
4567654
567898765
#for n==3
1
@atul-chaudhary
atul-chaudhary / pattern.py
Created September 1, 2019 06:03
Webkul: Campus placement pattern program (round 1 MIET campus 2016-2020 batch)
#webkul pattern program round 1
#pattern runs for odd number like min 3 , 5, 7 etc
#here is ther pattern
#for n==3
* *
** **
***@@@***
@@@
@@@
***