摘要:
Given an unsorted integer array,find missing postive integer. For example , Given [1,2,0]return 3, and [3,4,-1,1]return 2. Your algorithm should run i 阅读全文
摘要:
Best Time to Buy and Sell Stock 题目大意;给定数组a[..],求解max a[j]-a[i] j>i 解决思路:将数组a的相邻值相减(右边减左边)变换成数组b,上述问题 转变成了求数组b的子数组最大和问题。 public int maxEndingHere=0,max 阅读全文
摘要:
恢复内容开始 You are given an n x n 2D matrix representing an image. Ratate the image by 90 degrees(clockwise). Follow up:Could you do this in-place? 分析如下: 阅读全文