Skip to content

Instantly share code, notes, and snippets.

View Shubhaankar-Sharma's full-sized avatar
💭
Focusing

Shubhaankar Sharma Shubhaankar-Sharma

💭
Focusing
View GitHub Profile
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/shubhaankar/"
]
},
@Shubhaankar-Sharma
Shubhaankar-Sharma / vimrc
Last active July 6, 2021 11:09
spongeboi's vimrc
set nocompatible " be iMproved, required
filetype off " required
let python_highlight_all=1
"vim plug auto install
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
##login
import requests
API_ENDPOINT = "http://todoappshubhaankar.herokuapp.com/api/todo/hello/"
#data = {"username":"shubh","password":"choti@21"}
#r = requests.post(url = API_ENDPOINT, data = data)
r = requests.get(url = API_ENDPOINT)
pastebin_url = r.text
print(pastebin_url)
solution=lambda k:int(((2*(k//2)*(k//2+1)*(2*(k//2)+1))/3)-((k-k//2)*(4*((k-k//2)**2)-1))/3)
solution=lambda k:sum([box*box for box in [x for x in range(1,k+1)][1::2]])-sum([box*box for box in [x for x in range(1,k+1)][0::2]])
@Shubhaankar-Sharma
Shubhaankar-Sharma / solution.py
Created September 20, 2020 09:16
solution for medium blog
def solution(k):
sizes = [x for x in range(1,k+1)]
yellow_apples = [box*box for box in sizes[0::2] ]
red_apples = [box*box for box in sizes[1::2] ]
return sum(red_apples)-sum(yellow_apples)