Ryan
Ryan
```javascript class LRUCache { constructor (size) { this.size = size; this.caches = new Map() } put (key,val) { if (this.caches.size >= this.size) { this.caches.delete(this.caches.keys().next().value) this.caches.set(key,val) } else { this.caches.set(key,val) }...
```javaScript class minStack { constructor (){ this.stack = [] } push (e) { this.stack.push(e) } pop () { this.stack.pop() } top () { return this.stack[this.stack.length -1] } getMin () {...
```javaScript var reverse = function (sts) { return sts.trim().split(" ").reverse().join(" ") } ```
```javaScript function mixed (nums1,nums2) { return nums1.reduce((prev,cur) => { if (nums2.includes(cur)) { prev.push(cur) } return [...new Set(prev)]; },[]) } ```
`function check (url) { let reg = /^https?://\w+.qq.com[^.]*$/ return reg.test(url) }`