intlengthOfLongestSubstring(string s) { // Note: The Solution object is instantiated only once and is reused by each test case. intmax_len = 0,cur_len = 0; inthash[256]; for(inti=0;i<256;i++) hash[i] = -1; for(inti=0;i<s.size();i++) { if(hash[s[i]]==-1||hash[...
max sum of rectangle no larger than k: basically brute force version of 1D max sum of sub array no larger than k. Do a binary search to find any value > sum - k among previous sums. Binary search tree count complete tree nodes kth smallest element in a BST: in order traversal BFS ...