Skip to content

Instantly share code, notes, and snippets.

View Per48edjes's full-sized avatar
👉
This is a good point.

Ravi Dayabhai Per48edjes

👉
This is a good point.
View GitHub Profile
@Per48edjes
Per48edjes / fiddler_20240621.md
Last active July 1, 2024 04:32
Fiddler on the Proof: Fiddler (06/21/2024)

Fiddler on the Proof

Ravi Dayabhai & Conrad Warren 🧱 2024-06-21

Problem

Consider the following array of 25 squares:

You are filling the array with rectangles by repeating the following two steps:

@Per48edjes
Per48edjes / fiddler_20240614.md
Last active July 1, 2024 04:33
Fiddler on the Proof: Fiddler (06/14/2024)

Fiddler on the Proof

Ravi Dayabhai 🔵 2024-06-14

Problem

You want to pack four rows of unit circles into a rectangle with a base of 8. You’re considering two strategies for packing:

Square packing. In this case, four rows of circles each are packed in an array of squares.

@Per48edjes
Per48edjes / fiddler_20240607.ipynb
Last active July 1, 2024 04:34
Fiddler on the Proof: Fiddler (06/07/2024)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Per48edjes
Per48edjes / fiddler_20240601.ipynb
Last active July 1, 2024 04:34
Fiddler on the Proof: Fiddler (06/01/2024)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Per48edjes
Per48edjes / fiddler_20240524.ipynb
Last active June 4, 2024 18:05
Fiddler on the Proof: Fiddler (05/24/2024)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Per48edjes
Per48edjes / fiddler_20240517.ipynb
Last active May 25, 2024 00:53
Fiddler on the Proof: Fiddler (05/17/2024)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Per48edjes
Per48edjes / fiddler_05032024.md
Last active May 17, 2024 20:52
Fiddler on the Proof: Fiddler (05/03/2024)

Fiddler on the Proof

Ravi Dayabhai & Conrad Warren 🏃 2024-05-03

Problem

There are 25 sprinters at a meet, and there is a well-defined order from fastest to slowest. That is, the fastest sprinter will always beat the second-fastest, who will in turn always beat the third-fastest, and so on. However, this order is not known to you in advance.

To reveal this order, you can choose any 10 sprinters at a time to run in a heat. For each heat, you only know the ordinal results, so which runner finishes first, second, third, and so on up to 10th. You do not know the specific finishing time for any runner, making it somewhat difficult to compare performances across heats.

@Per48edjes
Per48edjes / case_2.txt
Created April 17, 2024 19:54
Useful test cases for Leetcode SQL 2701. Consecutive Transactions with Increasing Amounts
| transaction_id | customer_id | transaction_date | amount |
| -------------- | ----------- | ---------------- | ------ |
| 653 | 4 | 2019-8-9 | 5800 |
| 856 | 15 | 2019-7-26 | 1044 |
| 181 | 9 | 2019-7-25 | 1673 |
| 923 | 43 | 2019-7-21 | 2238 |
| 916 | 34 | 2019-7-22 | 2936 |
| 907 | 8 | 2019-8-29 | 5936 |
| 25 | 35 | 2019-7-17 | 8273 |
| 783 | 37 | 2019-7-3 | 4070 |
@Per48edjes
Per48edjes / trie.py
Created March 17, 2024 15:54 — forked from crlane/trie.py
An implementation of a trie in python using defaultdict and recursion
from collections import defaultdict
def node():
return defaultdict(node)
def word_exists(word, node):
if not word:
return None in node
return word_exists(word[1:], node[word[0]])
@Per48edjes
Per48edjes / cycle_sort.ipynb
Last active January 27, 2024 02:58
Walking myself through Cycle Sort
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.