摘要:
Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1len2){ for(int i=len2;i0?1:-1; return 0; }} 阅读全文
摘要:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
摘要:
A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文