Using the gist command-line tool called gist that simplifies interacting with Gists, including downloading them.
1. Install the gist tool:
macOS (with Homebrew):
brew install gist
Using the gist command-line tool called gist that simplifies interacting with Gists, including downloading them.
1. Install the gist tool:
macOS (with Homebrew):
brew install gist
/** | |
* --- | |
* [https://leetcode.com/problems/two-sum] | |
* Two Sum | |
* Given an array of integers nums and an integer target, return indices of | |
* the two numbers such that they add up to target. | |
* | |
* You may assume that each input would have exactly one solution, and you | |
* may not use the same element twice. | |
* |
*the following is based on the outline provided for Murex Dev Interview.
Picking the right architecture = Picking the right battles + Managing trade-offs
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
/** | |
* --- | |
* [https://leetcode.com/problems/binary-tree-right-side-view] | |
* 199. Binary Tree Right Side View | |
* Given the root of a binary tree, imagine yourself standing on the | |
* right side of it, return the values of the nodes you can see ordered | |
* from top to bottom. | |
* --- | |
*/ | |
class SolutionBFS { |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
/** | |
* --- | |
* [https://leetcode.com/problems/count-good-nodes-in-binary-tree] | |
* 1448. Count Good Nodes in Binary Tree | |
* Given a binary tree root, a node X in the tree is named good if in the path from root to X | |
* there are no nodes with a value greater than X. | |
* | |
* Return the number of good nodes in the binary tree. | |
* --- | |
*/ |
import java.util.Stack; | |
/** | |
* --- | |
* [https://leetcode.com/problems/decode-string] | |
* 394. Decode String | |
* Given an encoded string, return its decoded string. | |
* | |
* The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets | |
* is being repeated exactly k times. Note that k is guaranteed to be a positive integer. |
/** | |
* --- | |
* [https://leetcode.com/problems/asteroid-collision] | |
* 735. Asteroid Collision | |
* We are given an array asteroids of integers representing asteroids in a row. | |
* | |
* For each asteroid, the absolute value represents its size, and the sign represents its | |
* direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed. | |
* | |
* Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller |