Skip to content

Instantly share code, notes, and snippets.

View k26rahul's full-sized avatar

Rahul Maurya k26rahul

View GitHub Profile
@k26rahul
k26rahul / Week-2-PPA-15.py
Created June 12, 2023 18:41
Week 2 PPA 15 - Not Graded
n1 = int(input())
n2 = int(input())
n3 = int(input())
n4 = int(input())
if n1 <= n2 and n1 <= n3 and n1 <= n4:
if n2 <= n3 and n2 <= n4:
if n3 <= n4:
print(n1, n2, n3, n4)
else:
@k26rahul
k26rahul / calculateDaysSince.js
Last active June 26, 2023 15:06
Shows number of days between two dates.
let log = console.log.bind(console);
/*
January: 31
February: 28
March: 31
April: 30
May: 31
June: 30
July: 31
let daysInMonth = [31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function getDaysInMonth(m, y) {
if (m === 2 && y % 4 === 0) return 29;
return daysInMonth[m];
}
function ensureMonthOk(m, y) {
if (m < 0) {
y--;