Skip to content

Commit

Permalink
2025-02-19 17:13:10.474020 new snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocerqueira committed Feb 19, 2025
1 parent 9a0f399 commit bdc31b7
Show file tree
Hide file tree
Showing 25 changed files with 1,314 additions and 669 deletions.
39 changes: 39 additions & 0 deletions seeker/report.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
--------------------------------------------------------------------------------
2025-02-19 17:13:10.474020
--------------------------------------------------------------------------------
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: snippet/Florin_Arch.py
deleted: snippet/axolotl.sh
deleted: snippet/backrest-create-standby.sh
deleted: snippet/demote-db.sh
deleted: snippet/generate_context.sh
deleted: snippet/hello.py
deleted: snippet/heslunpack.py
deleted: snippet/mario-more.py
deleted: snippet/ngrams.py
deleted: snippet/pocketbase_webhooks.go
deleted: snippet/read_metadata_kps9566.py

Untracked files:
(use "git add <file>..." to include in what will be committed)
snippet/LC 378.py
snippet/build-ubuntu-23.sh
snippet/convert_url_files_to_bookmarks.sh
snippet/copy-playlist-tracks.sh
snippet/demo_box_sample.py
snippet/install_vmware_workstation_pro_17.sh
snippet/materialfix.sh
snippet/md_link_parser.py
snippet/network.py
snippet/nts-trax.py
snippet/parse-playlist.py
snippet/perceptron.py
snippet/up.sh

no changes added to commit (use "git add" and/or "git commit -a")

--------------------------------------------------------------------------------
2025-02-18 17:13:09.521639
--------------------------------------------------------------------------------
Expand Down
17 changes: 0 additions & 17 deletions seeker/snippet/Florin_Arch.py

This file was deleted.

41 changes: 41 additions & 0 deletions seeker/snippet/LC 378.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#date: 2025-02-19T16:46:18Z
#url: https://api.github.com/gists/ff56a38293867ea8ef15ae375fde3d09
#owner: https://api.github.com/users/qirh

"""
Similar to LC 378 -- The heap solution is more efficient
You have m arrays of sorted integers. Find the kth smallest value of all the values. The sum of the arrays' lengths is n.
Example:
Input Arrays: [
[1, 3, 5, 7],
[2, 4, 6],
[8, 9]
]
(k=5, m=3, n=9)
Output: 5
"""

from collections import deque

def get_kth_smallest_value(lists, k, n):
counter = 1
curr_value = None

queues = [deque(l) for l in lists]

while counter <= k:
smallest_el = None
smallest_q = None

for q in queues:
if len(q) > 0 and (smallest_el is None or q[0] < smallest_el):
smallest_el = q[0]
smallest_q = q
curr_value = smallest_el
smallest_q.popleft()
counter += 1


return curr_value
124 changes: 0 additions & 124 deletions seeker/snippet/axolotl.sh

This file was deleted.

80 changes: 0 additions & 80 deletions seeker/snippet/backrest-create-standby.sh

This file was deleted.

Loading

0 comments on commit bdc31b7

Please sign in to comment.