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
#!/bin/bash | |
# Color codes | |
GREEN='\033[1;32m' | |
RED='\033[1;31m' | |
CYAN='\033[1;36m' | |
NC='\033[0m' # No color | |
# Get the current branch name | |
current_branch=$(git rev-parse --abbrev-ref HEAD) |
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
11.36 Compiling vector v0.47.0 (/vector) | |
18.80 error: internal compiler error: encountered incremental compilation error with type_of(vector[a71f]::internal_events::batch::{impl#0}::emit::{constant#0}) | |
18.80 | | |
18.80 = help: This is a known issue with the compiler. Run `cargo clean -p vector` or `cargo clean` to allow your project to compile | |
18.80 = note: Please follow the instructions below to create a bug report with the provided information | |
18.80 = note: See <https://github.com/rust-lang/rust/issues/84970> for more information | |
18.80 | |
18.80 | |
18.80 thread 'rustc' panicked at /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/compiler/rustc_query_system/src/query/plumbing.rs:731:9: | |
18.80 Found unstable fingerprints for type_of(vector[a71f]::internal_events::batch::{impl#0}::emit::{constant#0}): EarlyBinder { value: {type error}, .. } |
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
#!/bin/bash | |
# Function to repeat a command for a certain duration | |
repeat_command() { | |
local command="$1" | |
local timeout="$2" | |
local end_time=$((SECONDS + timeout)) | |
while [ $SECONDS -lt $end_time ]; do | |
eval "$command" |
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: | |
rank = {} | |
graph = defaultdict(list) | |
conn_dict = {} | |
def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]: | |
self.formGraph(n, connections) | |
self.dfs(0, 0) |
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. | |
* struct TreeNode { | |
* int val; | |
* TreeNode *left; | |
* TreeNode *right; | |
* TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
* }; | |
*/ | |
class Solution { |
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 { | |
public: | |
int leastInterval(vector<char>& tasks, int n) { | |
vector<int> freqs(26); | |
for (char c : tasks) { | |
freqs[c - 'A']++; | |
} | |
// max heap | |
priority_queue<int> pq; |
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 { | |
bool isSimilar(const string& a, const string& b) { | |
if (a.size() != b.size()) return false; | |
int count = 0; | |
for (int i = 0; i < a.size(); ++i) { | |
if (a[i] != b[i]) { | |
count++; | |
} | |
if (count > 2) return false; |