Skip to content

Instantly share code, notes, and snippets.

View Jothin-kumar's full-sized avatar
❤️
Mathematics

Jothin Kumar Jothin-kumar

❤️
Mathematics
View GitHub Profile
@Jothin-kumar
Jothin-kumar / build.sh
Last active November 16, 2024 13:04
Use this file to build (minify) static websites written in HTML, JS and CSS
set -e
if [ -d "build" ]
then
cd build
git pull
cd ../
else
git clone https://github.com/Jothin-kumar/build.git
fi
@Jothin-kumar
Jothin-kumar / word-rank.py
Last active November 16, 2024 13:07
Finding the rank of a word, as in a dictionary
from math import factorial
def word_rank(word: str) -> int:
rank = 1
L = len(word)
for i, l in enumerate(word):
k = 0
for r in word[i+1:]:
if r < l:
k += 1
@Jothin-kumar
Jothin-kumar / flames.py
Last active November 16, 2024 13:11
Calculate FLAMES between yourself and your crush
def get_letters(name):
letters = []
for letter in name.lower():
if letter.isalpha():
letters.append(letter)
return letters
name1_letters = get_letters(input("Enter name 1: "))
name2_letters = get_letters(input("Enter name 2: "))
# cancel common letters
@Jothin-kumar
Jothin-kumar / pascal-triangle.py
Last active November 16, 2024 13:12
Python program to display the pascal triangle
rows_count = int(input("Enter no.of rows to display: ")) # (first row is not counted)
result = [[1]]
for i in range(rows_count):
r = [1, 1]
prev = result[-1]
for i in range(len(prev)-1):
r.insert(i+1, prev[i] + prev[i+1])
result.append(r)
@Jothin-kumar
Jothin-kumar / happy-independence-day-national-flag-with-html-and-scss.markdown
Created August 15, 2022 07:42
Happy independence day - National flag with HTML and SCSS