This file contains 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
const obj = [{ | |
pid: 'p1', | |
bid: 'b1', | |
qid: 'q1', | |
}, { | |
pid: 'p1', | |
bid: 'b2', | |
qid: 'q2', | |
}, { | |
pid: 'p1', |
This file contains 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
//Implement the BSTIterator class that represents an iterator over the in-order | |
//traversal of a binary search tree (BST): | |
// | |
// | |
// BSTIterator(TreeNode root) Initializes an object of the BSTIterator class. Th | |
//e root of the BST is given as part of the constructor. The pointer should be ini | |
//tialized to a non-existent number smaller than any element in the BST. | |
// boolean hasNext() Returns true if there exists a number in the traversal to t | |
//he right of the pointer, otherwise returns false. | |
// int next() Moves the pointer to the right, then returns the number at the poi |
This file contains 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
//Given an array of non-negative integers nums, you are initially positioned at | |
//the first index of the array. | |
// | |
// Each element in the array represents your maximum jump length at that positio | |
//n. | |
// | |
// Determine if you are able to reach the last index. | |
// | |
// | |
// Example 1: |
This file contains 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
//Given two strings s and p, return an array of all the start indices of p's ana | |
//grams in s. You may return the answer in any order. | |
// | |
// | |
// Example 1: | |
// | |
// | |
//Input: s = "cbaebabacd", p = "abc" | |
//Output: [0,6] | |
//Explanation: |
This file contains 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
DROP TABLE IF EXISTS users; | |
CREATE TABLE users | |
( | |
id bigint AUTO_INCREMENT PRIMARY KEY, | |
nick_name varchar(20) | |
); | |
CREATE TABLE users2 | |
( | |
id bigint AUTO_INCREMENT PRIMARY KEY, |
This file contains 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
<html> | |
<head> | |
<style> | |
.banner { | |
height: 300px; | |
background: aquamarine; | |
} | |
</style> | |
</head> | |
<body> |
This file contains 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
TestingLibraryElementError: Unable to find an element by: [data-tn="mlsSearchFilters-descWithCodeTypeaheadCheckbox"] | |
<body> | |
<div> | |
<div | |
aria-expanded="false" | |
aria-haspopup="listbox" | |
aria-labelledby="downshift-0-label" | |
class="uc-descWithCodeTypeahead" |
This file contains 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
WITH orders AS ( | |
SELECT review, channel, t.product._id pid, t.product.martspec, t.product.costprice, t.product.price, "create" | |
FROM (SELECT * FROM db_orders WHERE "create" BETWEEN timestamp '2020-11-01 00:00:00' AND timestamp '2020-11-30 23:59:00' AND paid = TRUE) orders | |
CROSS JOIN unnest(products) AS t(product) | |
) | |
-- 2018-03-21 12:29:05 | |
, reviews AS ( | |
SELECT r.name reviewName, c.name channelName, m._id mid, r._id rid | |
FROM db_reviews r |
This file contains 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
//A message containing letters from A-Z is being encoded to numbers using the fo | |
//llowing mapping: | |
// | |
// | |
//'A' -> 1 | |
//'B' -> 2 | |
//... | |
//'Z' -> 26 | |
// | |
// |
This file contains 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
let inputs = [1, 4, 2, 7, 5] | |
function quickSortImpl(nums, pivot) { | |
if (nums.length == 0) { | |
return [] | |
} | |
return [...quickSortImpl(nums.filter(n => n < nums[pivot]), 0), nums[pivot], ...quickSortImpl(nums.filter((n, i) => n >= nums[pivot] && i != pivot), 0)] | |
} |