Betty

Results 2 comments of Betty

var simplifyPath = function(path) { const path2array = path.split('/') let stack = [] for(let i=0 ; i

var isValid = function(s) { let st = [] // 存储配对符号字典 const flagMap = new Map([['(', ')'], ['{', '}'], ['[', ']']]) // 1.遇到'(|{|['压入栈 // 2.遇到')|}|]', 判断栈头是否与当前符号一致,并出栈 for(let i=0; i