B. Vile Grasshoppers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The weather is fine today and hence it's high time to climb the nearby pine and enjoy the landscape. The pine's trunk in…
题目: 给定一个数组,求如果排序之后,相邻两数的最大差值,要求时间复杂度为O(N),且要求不能用非基于比较的排序 public static int maxGap(int nums[]) { if (nums == null || nums.length < 2) { return 0; } int len = nums.length; int max = Integer.MIN_VALUE; int min = Integer.MAX_VALUE; for (int i = 0; i < l…