kth smallest element in a sorted matrix: binary search of guessed number and find its position in matrix kth smallest number in multiplication table: basically kthe smallest element in a sorted matrix. Guess the answer and binary search for it. split array largest sum: search of largest sum ...
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[...