這一題其實以前就有寫過,只是當時還不知道Two Pointer的解題技巧,也是用迴圈粗暴解決,後來為了想要刻意練習使用Two Pointer技巧,又再重寫一次題...
今天來解YKL06(UVA10190):Divide, But Not Quite Conquer
Divide, But Not Quite Conquer...
100. Same Tree
tags: Easy、Tree
Given the roots of two binary trees p and q, wri...
572. Subtree of Another Tree
tags: Easy、Tree
Given the roots of two binary tree...
解題程式碼
var checkValidString = function (s) {
let leftMin = 0;
let leftMax = 0...
題目:
這題要求在給定的字串中找到第一個不重複的字元,並回傳它的索引。如果不存在不重複字元,則回傳 -1。
解題思路
使用 hasp map (unordere...