上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 16 下一页
摘要: 思路:比较easy。就是借助hashset让他有序然后就能够比较节省时间了。答案: public static int[] getRankOfNumber(int[] a, int n){ int[] res = new int[n]; HashSet ha... 阅读全文
posted @ 2016-01-05 11:46 创业-李春跃-增长黑客 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1,牛客网第一题:这其实跟找最长递增子序列是一个东西。注意的地方是,返回的是最大的dp,而不是dp[N-1]。答案:public static int getHeight(int[] men, int n) { // write code here int res = 0... 阅读全文
posted @ 2016-01-04 23:54 创业-李春跃-增长黑客 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 思路,一旦提到查找就要想到二分查找。 public static int[] findElement(int[][] a, int n, int m, int key) { // write code here int[] res = new int[2]; ... 阅读全文
posted @ 2016-01-04 23:42 创业-李春跃-增长黑客 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 注意,1,"" 和 " "。是不同的,空字符串指的是"";2,注意String的compareTo。小于是指 left && a[mid] == "") { mid--; } if(key.equals... 阅读全文
posted @ 2016-01-04 23:18 创业-李春跃-增长黑客 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 思路,这道题用二分,唯一的不同就是,1,a[left]= a[left]){ right = mid -1; } else{ left = mid + 1; ... 阅读全文
posted @ 2016-01-04 21:56 创业-李春跃-增长黑客 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 这道题主义的就是,要利用数组自带的sort函数。此外,注意,利用hash来判断是否出现了。 public static ArrayList sortStrings(String[] str, int n) { // write code here Arra... 阅读全文
posted @ 2016-01-04 21:09 创业-李春跃-增长黑客 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1,牛客网的解题思路:其实这就是求一个最长的递增子序列。 以某一个箱子结尾的最大高度=放在它上面的所有类型中高度最大的那个+他自己的高度。import java.util.*; public class Box { public int getHeight(int[] w, int[] l,... 阅读全文
posted @ 2016-01-04 17:10 创业-李春跃-增长黑客 阅读(544) 评论(0) 推荐(0) 编辑
摘要: 思路:首先写一个检查能不能摆的函数。boolean checkValid(int[] columns,int row1, int column1);意思是row1行摆在column1列可不可以。然后是place函数。第一个参数row表示现在摆第几行。第一行可以摆n次位置,然后往下也是8ci。也就是相... 阅读全文
posted @ 2016-01-04 10:31 创业-李春跃-增长黑客 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 这道题比较简单,就是通过从后往前复制大的就可以了。最后比较注意的就是如果B还没复制完要记得接着复制。import java.util.Arrays;public class Solution{ public static void main(String[] args){ int... 阅读全文
posted @ 2016-01-04 00:00 创业-李春跃-增长黑客 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 这道题卡了一天。要想AC非常难。1,第一个解决办法,优化暴力:public class Coins { public static int countWays(int n){ int num25 = n / 25; long res = 0; for(int i = 0; i ... 阅读全文
posted @ 2016-01-03 23:00 创业-李春跃-增长黑客 阅读(274) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 16 下一页