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
/** | |
* @param {number[]} nums1 | |
* @param {number} m | |
* @param {number[]} nums2 | |
* @param {number} n | |
* @return {void} Do not return anything, modify nums1 in-place instead. | |
*/ | |
// NOTE: extra space: O(m), time: O(n + m) | |
var merge = function(nums1, m, nums2, n) { | |
nums1Copy = Array(m); |
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: | |
# NOTE: extra space: O(m), time: O(n + m) | |
def merge(self, nums1: List[int], m: int, nums2: List[int], n: int) -> None: | |
""" | |
Do not return anything, modify nums1 in-place instead. | |
""" | |
nums1_copy = [None] * m | |
for i in range(m): | |
nums1_copy[i] = nums1[i] | |
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
// this function allows us to stop our code for |ms| milliseconds. | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
// I've put our main code into this function. | |
async function addPeople() { | |
ul = $('ul.mn-pymk-list__cards')[0]; | |
firstLi = ul.querySelector('li'); | |
count = 0; // this is the count of how many people you've added |
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
import time | |
Ts = [] | |
Ns = [] | |
for multiple in range(1, 11): | |
N = 10 * multiple | |
Ns.append(N) | |
STR_LENGTH = 3000 | |
root = Node('a'*STR_LENGTH) | |
current = root | |
N_trials = 10 |
NewerOlder