const a = await page.evaluate(selector => document.querySelector(selector).textContent, WELCOMETAG_SELECTOR)const b = await page.$eval(WELCOMETAG_SELECTOR, stuff => stuff.textContent)While watching André Staltz's excellent Two Fundamental Abstractions talk, he shared something like this about 24 minutes into his talk:
const a = b => b(10)
a(x => console.log(x))| ;with persons as ( | |
| select id, name, gender, color | |
| from ( | |
| values | |
| (1,'kevin','m','blue') | |
| ,(2,'owen','m','blue') | |
| ,(3,'wendy','f','pink') | |
| ,(4,'emrys','m','black') | |
| ,(5,'aria','f','brown') | |
| ) q (id, name, gender, color) |
| select | |
| ranked = case | |
| when color <> 'black' then | |
| row_number() over (partition by | |
| case when color <> 'black' then 1 end | |
| ,person | |
| order by (select null) | |
| ) | |
| else null |
| --;with q as ( | |
| -- select id, color, intensity | |
| -- from ( | |
| -- values | |
| -- (1,'blue',4) | |
| -- ,(2,'red',5) | |
| -- ,(3,'blue',7) | |
| -- ,(4,'blue',1) | |
| -- ,(5,'yellow',3) | |
| -- ) colors (id, color, intensity) |
| ;with names as ( | |
| select name, color | |
| from ( | |
| values | |
| ('kevin','blue') | |
| ,('kevin','blue') | |
| ,('kevin','red') | |
| ) x (name, color) | |
| ) | |
| select |
| --https://stackoverflow.com/questions/31211506/how-stuff-and-for-xml-path-work-in-sql-server | |
| --https://stackoverflow.com/questions/273238/how-to-use-group-by-to-concatenate-strings-in-sql-server | |
| ;with colors as ( | |
| select id, name, color | |
| from ( | |
| values | |
| (1, 'kevin', 'blue') | |
| ,(2, 'kevin', 'red') | |
| ,(3, 'aria', 'pink') |
This problem was asked by Uber.
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6].
function aryTransform(input) {This problem was recently asked by Google.
Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
function isAddedNumberInArray(inputAry, n) {
return (
inputAryGood morning! Here's your coding interview problem for today.
This problem was asked by Amazon.
Run-length encoding is a fast and simple method of encoding strings. The basic idea is to represent repeated successive characters as a single count and character. For example, the string "AAAABBBCCDAA" would be encoded as "4A3B2C1D2A".
Implement run-length encoding and decoding. You can assume the string to be encoded have no digits and consists solely of alphabetic characters. You can assume the string to be decoded is valid.
function decode(input) {