Skip to content

Instantly share code, notes, and snippets.

View nvshah's full-sized avatar
🎯
Focusing

Nipun Shah nvshah

🎯
Focusing
View GitHub Profile
@nvshah
nvshah / R1.txt
Created January 26, 2023 11:24
ZenRev
1) Impact
I've consistently shown commitment and motivation ever since I joined the organization
This helps me demonstrating the significant work values.
I meet set deadlines and objectives most of the time. 
I manage my time effectively by prioritising the important tasks.
I often go above and beyond to match targets and expectations.
I'm extremely proud of my contributions and what I've achieved over the past year.
import 'package:freezed_annotation/freezed_annotation.dart';
part 'test_case_2.freezed.dart';
part 'test_case_2.g.dart';
/*
@Default() should override the defaultValue or custom @JsonKey annotations
1) For 'name' field : JsonKey will respect @DefaultValue annotation & add key:value pair for same
2) For 'age' field : As JsonKey possess its own defaultValue param so it will not lookup for @DefaultValue annotation
@nvshah
nvshah / LCS.py
Last active March 10, 2021 18:34
Dynamic Programming - Longest Common Subsequence
import logging
'''
AIM :- LONGEST COMMON SUBSEQUENCE (DP) (MEMOIZING)
NOTE : matrix will hold strings as their character starting at 1...
1st chr of str will be access via index 1 and so on...
String are matched as case sensitive
'''
@nvshah
nvshah / KnapSack.py
Last active June 16, 2020 13:55
Dynamic Programming - KnapSack Problem
from enum import Enum
import logging
### Globals-------------------------------------------------------------------------------------------------------------------
selectedItems = [] # current set of item that form the solution
Matrix_PossibleWays_RepeatOFF = [] # Each member represents the max value possible with given items
Matrix_PossibleWays_RepeatON = [] # Each member represents the max value possible with given items , repeatation of items is allowed
Matrix_MinimalItems_RepeatOFF = [] # Each member represents the (min weight, max value, min items) possible with given items
@nvshah
nvshah / Coin_Change.py
Last active June 11, 2020 07:47
Dynamic Programming - Coins Change Problem
from enum import Enum
import logging
### Globals-------------------------------------------------------------------------------------------------------------------
Matrix_PossibleWays_RepeatOFF = [] # Each member represents the total amount possible with given coins set
Matrix_PossibleWays_RepeatON = [] # Each member represents the number of possible ways with given coins set, repeatation of coins is allowed
Matrix_MinimalCoins_RepeatOFF = [] # Each member represents the minimal number of coins required with given coins set at moment
Matrix_MinimalCoins_RepeatON = [] # Each member represents the minimal number of coins required with given coins set at moment, repeatation of coins is allowed
@nvshah
nvshah / JurrasicPark.py
Last active April 14, 2020 15:32
Jurrasic Park | Codevita 2018
import logging, math
### Globals-------------------------------------------------------------------------------------------------------------------
visited = [] # to keep track of visited elements/area/piece while searching path
found = False # denotes if path is found between target & source in parkLayout
totalGrassLandsCount = 0
safeGrassLandsCount = 3 # Gates are already safe
### Functions-------------------------------------------------------------------------------------------------------------------
def initiatePathSearch(source, destination, optimal = True, monster = False):
@nvshah
nvshah / BookScan_HashCode_2020.py
Last active June 17, 2020 15:11
HashCode 2020 BookScanning
### Global Variables -----------------------------------------------------------------------------------------------
scanUpDays = {-1:0} # track of first scanning day for each library
signUpDays = {} # track of signup day for each library
processingLibrary = -1 # track of library that have initiated signup process but not yet complete. it's always going to be one at a time
activeLibraries = [] # track of libraries that have started scanning process
completeLibraries = [] # track of libraries that have completed scanning of all unscanned books
bookHub = [] # global repo of scanned books
previousDayBooks = [] # temporary to keep track of books scanned previous day, inorder to update waiting queue by removing all books that are scanned
reSchedule = 0 # Use when waiting queue need to be jumble due to removal of some scanned books inorder to avoid those scanned books again to repo
Libraries = [] # Element Format -> [ (N,T,M), [b1, b2, ... bN] ]
@nvshah
nvshah / Pizzeria.py
Last active May 19, 2020 06:02
HashCode 2020
# M - max pizza's slices
# N - number of pizza
M,N = map(int, input().split())
#Slices Count for each pizza
slicesCount = list(map(int, input().split()))
#To store memoized values for given pizza & given desired slice at moment
pizzeria = []
# List of pizza selected to fulfill the order
selectedPizza = []
#Memoization, (DP)
@nvshah
nvshah / 2WordsAdj
Last active February 2, 2020 18:58
Puritanical outlook : [ sakht najre, stern look ]
Honor unbesmirched
debauched lifestyle : [ anaitik jivan ]
sartorial elegance : [ kapde ki chamak ]
mewling fool
fuckin idiot
Adolescent crush
@nvshah
nvshah / Idioms & Phrases
Last active March 9, 2020 11:28
Idioms, Phrases, Slangs, Proverbs
Date : 12/5/19
Hit the hay : tired & want to go to sleep
To be in one's shoes : facing same situation same as one.
having same problem as another
To get foot in the door : to begin with