Kth Largest Element in an Array
摘要:【重要的事情写在前面】先来说说swap的实现方式,这道题我本来自己写了个swap的算法,除了通常的swap(type& a, type& b){ type t = a; a = b; b = a;}的写法外,还有一种【极客】写法:swap(type& a, type& b){ a ^= b;...
阅读全文
Maximal Square
摘要:Problem:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the follow...
阅读全文