摘要:
Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/spac... 阅读全文
摘要:
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som... 阅读全文
摘要:
Implement pow(x,n).注意n等于INT_MIN的时候,直接让n = -n会整形溢出.二分法: 1 class Solution { 2 public: 3 double pow(double x, int n) { 4 if (n == 0) return 1... 阅读全文