You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E-Tag 的生成
维基百科:Common methods of ETag generation include using a collision-resistant hash function of the resource's content, a hash of the last modification timestamp, or even just a revision number.
括号匹配那道题,再次吐槽,是谁给我的勇气写出那么丑的代码??!!
// let str = '{[()]}';letstr='{{]]()'constresolution=(s)=>{letmap=newMap();map.set('[',']');map.set('{','}');map.set('(',')');letstack=[];for(leti=0;i<s.length;i++){if(map.get(s[i])){stack.push(map.get(s[i]));}else{if(stack.length){if(stack.pop()!=s[i]){returnfalse;}}else{returnfalse;}}}if(stack.length){returnfalse;}else{returntrue;}}console.log(resolution(str));
The text was updated successfully, but these errors were encountered: