Skip to content

Instantly share code, notes, and snippets.

View soumyadeepdutta's full-sized avatar
🏠
Working from home

Soumyadeep Dutta soumyadeepdutta

🏠
Working from home
View GitHub Profile
@soumyadeepdutta
soumyadeepdutta / grokking_to_leetcode.md
Created May 29, 2023 05:28 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@soumyadeepdutta
soumyadeepdutta / dalle.py
Created February 20, 2023 19:13
Generates image from text using OPEN APIs dall-e 2
import requests
import json
# The prompt for DALL-E to generate an image from
prompt = "monalisa ridding a bicycle"
# Generate the image using the DALL-E API
API_KEY = "get-one-from-openai"
url = "https://api.openai.com/v1/images/generations"
headers = {
a = 1
print(type(a)) # prints <class 'int'>
a = "The Curious Programmer" # re-assigning
print(type(a)) # prints <class 'str'>
@soumyadeepdutta
soumyadeepdutta / CountDigits.java
Created November 25, 2020 13:08
Count the digits of a number
public class CountDigits {
public static int digits_b(int num){
return (int) (Math.log10(num) + 1);
}
public static void main(String[] args) {
System.out.println(digits_b(10001));
}
}