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 {string} s | |
* @param {string} p | |
* @return {number[]} | |
*/ | |
var findAnagrams = function(s, p) { | |
const target = p.split("").reduce((res, c) => { | |
res[c] = (res[c] || 0) + 1; | |
return res; | |
}, {}); |
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
export default function diff (parentNode, prevNodeMap, newNodeMap) { | |
let lastIndex = 0 | |
let lastRightNode = null | |
let patch = [] | |
let mountIndex = 0 | |
for (let name in newNodeMap) { | |
if (newNodeMap.hasOwnProperty(name)) { | |
let newNode = newNodeMap[name] | |
let prevNode = prevNodeMap[name] | |
if (prevNode) { |
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
function StartTagToken(){ | |
} | |
function EndTagToken(){ | |
} | |
function Attribute(){ | |
} |