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
// http://a.tbcdn.cn/p/mall/2.0/js/direct-promo.js | |
/** | |
* 钻石平台定投广告 | |
* | |
* @creator [email protected] | |
* @depends ks-core | |
*/ | |
KISSY.use('core', function(S){ | |
/** |
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
// https://hackernoon.com/functional-javascript-resolving-promises-sequentially-7aac18c4431e | |
// https://decembersoft.com/posts/promises-in-serial-with-array-reduce/ | |
function delay() { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log('RESOLVED') | |
resolve() | |
}, 1000 * 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
var numDecodings = function (s) { | |
const availableNumStr = {}; | |
const cache = {} | |
let i = 1; | |
// 首先标记哪些数字可以解码为字母 | |
while (i < 27) { | |
availableNumStr[i.toString()] = true; | |
i++; | |
} |