-
To create a virtual environment inside the project
$ python -m venv env
-
To activate the virtual environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import package | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import math | |
def trianguler_mf(x,a,b,c): | |
if x<=a: | |
return 0 | |
elif a <= x <= b: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Owner : Hritik Jaiswal | |
Date : Nov 26 2020 | |
Topic : To simulate a Single Server Queuing System (One-operator Barbershop problem) using Python | |
Subject : Modeling and simulation | |
''' | |
import random | |
# Seed |
A Chinese automobile company Geely Auto aspires to enter the US market by setting up their manufacturing unit there and producing cars locally to give competition to their US and European counterparts. They have contracted an automobile consulting company to understand the factors on which the pricing of cars depends. Specifically, they want to understand the factors affecting the pricing of cars in the American market, since those may be very different from the Chinese market. The company wants to know:
- Which variables are significant in predicting the price of a car
- How well those variables describe the price of a car
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author : Hritik Jaiswal | |
Problem : https://www.hackerrank.com/contests/hackerrank-hackfest-2020/challenges/stones-piles | |
Date : October 17 2020 | |
Reference : https://www.youtube.com/watch?v=WxshQC9VDag | |
Challenge : Hackerrank HackFest 2020 | |
''' | |
def maximumStones(arr): | |
# Write your code here | |
oddStone = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author : Hritik Jaiswal | |
Problem : https://www.hackerrank.com/contests/hackerrank-hackfest-2020/challenges/cyclic-binary-string | |
Date : October 17 2020 | |
Reference : https://www.youtube.com/watch?v=h3B49vlhbEw | |
Challenge : Hackerrank HackFest 2020 | |
''' | |
def maximumPower(s): | |
# Write your code here | |
n = len(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Google Kick Start - Round A - Q2 - Plates | |
''' | |
Author : Hritik Jaiswal | |
Problem : https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc7/00000000001d40bb | |
Date : October 8 2020 | |
''''' | |
''' | |
Sample input : | |
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TIC TAC TOE Minmax algorithm | |
''' | |
1. Backtracking algorithm | |
2. Max wiil try to maximize it utility | |
3. Min will try to minimize user or human utility to win | |
4. Time complexity : O(b^d) | |
b : branching factor (choices, number of possible move) | |
d : depth |