摘要:
341 如果用栈应该就是这样解决,当然也可以直接用个list顺序递归往里面加就可以了 /** * // This is the interface that allows for creating nested lists. * // You should not implement it, or 阅读全文
摘要:
71 思路是先用split方法按"/"分割,这样多个/连一起的字符串就会被分割为空 就可以直接和"."一样跳过处理 class Solution { public String simplifyPath(String path) { LinkedList<String> stack = new Li 阅读全文
摘要:
1825 public static int maxProfit(int[] prices) { if (prices.length == 0 || prices.length == 1){ return 0; } int sel = 0; int min = prices[0]; for (int 阅读全文