sudo dnf check-update
sudo dnf update
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
| // Breadth First Search (BFS) | |
| function levelOrder(root) { | |
| if (!root) return; | |
| const queue = [root]; | |
| const result = []; | |
| let index = 0; | |
| while (index < queue.length) { | |
| const currentNode = queue[index++]; | |
| result.push(currentNode.data); | |
| if (currentNode.left) queue.push(currentNode.left); |
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
| function isBalanced(s) { | |
| const pattern = /\[\]|\(\)|\{\}/g; | |
| while (pattern.test(s)) { | |
| s = s.replace(pattern, ""); | |
| } | |
| return s ? "NO" : "YES"; | |
| } |
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
| function analyzeFrequencies(str) { | |
| const frequencies = {}; | |
| for (const char of str) { | |
| frequencies[char] = (frequencies[char] || 0) + 1; | |
| } | |
| return frequencies; | |
| } | |
| // Factory function for leaf node | |
| function createLeaf(char, frequency) { | |
| return { |
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 Node { | |
| constructor(data) { | |
| this.data = data; | |
| this.left = null; | |
| this.right = null; | |
| } | |
| } | |
| function insert(root, data) { | |
| if (root === null) { | |
| return new Node(data); |
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 Node { | |
| constructor(data) { | |
| this.data = data; | |
| this.left = null; | |
| this.right = null; | |
| } | |
| } | |
| function insert(root, data) { | |
| if (root === null) { | |
| return new Node(data); |
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
| function height(root) { | |
| if (root === null) return -1; | |
| return 1 + Math.max(height(root.left), height(root.right)); | |
| } |
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
| function createNodes(costs) { | |
| return costs.map(cost => ({ | |
| cost, | |
| adj: [], | |
| visited: false, | |
| solved: false | |
| })); | |
| } | |
| function buildGraph(nodes, edges) { | |
| for (let [a, b] of edges) { |
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/zsh | |
| usage() { | |
| echo "https://github.com/facefusion/facefusion" | |
| echo "Usage: $0 -s source_image -t target_image [-r reference_face_position] [-e]" | |
| echo " -s: Path to the source image" | |
| echo " -t: Path to the target image" | |
| echo " -r: Reference face position (default: 0)" | |
| echo " -e: Toggle to remove the face enhancer (optional)" | |
| exit 1 |