This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for a binary tree node. | |
# class TreeNode: | |
# def __init__(self, val=0, left=None, right=None): | |
# self.val = val | |
# self.left = left | |
# self.right = right | |
class Solution: | |
def kthSmallest(self, root: Optional[TreeNode], k: int) -> int: | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
class UnionFind: | |
def __init__(self, total: int): | |
# each node's parent is itself | |
self.parents = list(range(total)) | |
# for union by rank optimisation | |
self.ranks = [1 for _ in range(total)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from typing import List | |
class Solution: | |
def findAnagrams(self, s: str, p: str) -> List[int]: | |
''' | |
anagram is just an unordered bag of letters | |
2 pointer sliding window approach on s? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
DIRS = [ | |
(+1, 0), | |
(0, +1), | |
(-1, 0), | |
(0, -1) | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIGIT_TO_LETTERS = { | |
"2": ["a", "b", "c"], | |
"3": ["d", "e", "f"], | |
"4": ["g", "h", "i"], | |
"5": ["j", "k", "l"], | |
"6": ["m", "n", "o"], | |
"7": ["p", "q", "r", "s"], | |
"8": ["t", "u", "v"], | |
"9": ["w", "x", "y", "z"], | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for a binary tree node. | |
# class TreeNode: | |
# def __init__(self, val=0, left=None, right=None): | |
# self.val = val | |
# self.left = left | |
# self.right = right | |
class Solution: | |
def buildTree(self, preorder: List[int], inorder: List[int]) -> Optional[TreeNode]: | |
# build hashmap of indices | |
num_to_inorder_idx: dict[int, int] = {num: idx for idx, num in enumerate(inorder)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
class Solution: | |
def subsets(self, nums: List[int]) -> List[List[int]]: | |
''' | |
DFS | |
naive solution: choose or don't choose at each index | |
mental notes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
# two-pointer solution | |
def threeSum(self, nums: list[int]) -> list[int]: | |
nums.sort() | |
seen = set() | |
len_nums = len(nums) | |
result_triplets = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minhtoo@minhtoo:~/.nextflow/capsule/deps$ jstack 63923 | |
2024-01-23 02:54:51 | |
Full thread dump OpenJDK 64-Bit Server VM (17.0.6+10-LTS mixed mode, sharing): | |
Threads class SMR info: | |
_java_thread_list=0x00007f46f0001890, length=38, elements={ | |
0x00007f4748028010, 0x00007f4748167420, 0x00007f4748168800, 0x00007f4748177b10, | |
0x00007f4748178ec0, 0x00007f474817a2d0, 0x00007f474817bd00, 0x00007f474817d230, | |
0x00007f474817e6a0, 0x00007f47481b30f0, 0x00007f47481b5050, 0x00007f4748fc0990, | |
0x00007f474892a1c0, 0x00007f4748de2880, 0x00007f4749203220, 0x00007f47494b6d80, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jan-23 02:39:35.355 [main] DEBUG nextflow.cli.Launcher - $> nextflow run genepi/nf-gwas -r v1.0.4 -profile test,docker | |
Jan-23 02:39:35.404 [main] INFO nextflow.cli.CmdRun - N E X T F L O W ~ version 23.10.1 | |
Jan-23 02:39:35.422 [main] DEBUG nextflow.plugin.PluginsFacade - Setting up plugin manager > mode=prod; embedded=false; plugins-dir=/home/minhtoo/.nextflow/plugins; core-plugins: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] | |
Jan-23 02:39:35.429 [main] INFO o.pf4j.DefaultPluginStatusProvider - Enabled plugins: [] | |
Jan-23 02:39:35.430 [main] INFO o.pf4j.DefaultPluginStatusProvider - Disabled plugins: [] | |
Jan-23 02:39:35.432 [main] INFO org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode | |
Jan-23 02:39:35.440 [main] INFO org.pf4j.AbstractPluginManager - No plugins | |
Jan-23 02:39:35.452 [main] DEBUG nextflow.scm.ProviderConfig - Using SCM config path: /home/minhtoo/.nextflow/scm | |
Jan-23 02: |
NewerOlder