*the following is based on the outline provided for Murex Dev Interview.
Click to expand the learning outline for Language Basics
*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 |
/** | |
* --- | |
* [https://leetcode.com/problems/removing-stars-from-a-string] | |
* 2390. Removing Stars From a String | |
* You are given a string s, which contains stars *. | |
* | |
* In one operation, you can: | |
* - Choose a star in s. | |
* - Remove the closest non-star character to its left, as well as remove the star itself. | |
* |
/** | |
* --- | |
* [https://leetcode.com/problems/equal-row-and-column-pairs] | |
* 2352. Equal Row and Column Pairs | |
* Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that | |
* row ri and column cj are equal. | |
* | |
* -not fully happy though- | |
* --- | |
*/ |