上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: 牛客网81 描述 假设你有一个数组prices,长度为n,其中prices[i]是某只股票在第i天的价格,请根据这个价格数组,返回买卖股票能获得的最大收益 1. 你可以多次买卖该只股票,但是再次购买前必须卖出之前的股票 2. 如果不能获取收益,请返回0 3. 假设买入卖出均无手续费 数据范围: 1 阅读全文
posted @ 2023-10-29 20:20 樱圃 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2023-10-29 20:18 樱圃 阅读(4) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int mySqrt(int a) { if(a < 2) return a; int start = 2; int end = a/2; int mid = 0; while(start <= end) { mid = start + 阅读全文
posted @ 2023-10-29 20:06 樱圃 阅读(1) 评论(0) 推荐(0) 编辑
摘要: public boolean isValid(String s) { Stack<Character> stack = new Stack<>(); Map<Character,Character> map = new HashMap<>(); char[] chars = s.toCharArra 阅读全文
posted @ 2023-10-29 20:02 樱圃 阅读(13) 评论(0) 推荐(0) 编辑
摘要: public List<List<Integer>> fourSum(int[] nums, int target) { List<List<Integer>> list = new ArrayList<>(); Arrays.sort(nums); int k = 0; // k 的循环 whil 阅读全文
posted @ 2023-10-29 19:25 樱圃 阅读(2) 评论(0) 推荐(0) 编辑
摘要: //思路2:从前向后遍历数组,将非0数字放入一个集合中 public static void moveZeroes02(int[] nums) { if(nums == null || nums.length == 0) { return; } if(nums.length == 1) { retu 阅读全文
posted @ 2023-10-29 17:24 樱圃 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2023-10-29 17:17 樱圃 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import csv file = 'D:\\1.csv' with open(file, encoding="UTF8") as f: reader = csv.reader(f) # 创建 读取器 header_row = next(reader) # 获取表的第一行(一般是列名) print( 阅读全文
posted @ 2023-10-29 17:12 樱圃 阅读(22) 评论(0) 推荐(0) 编辑
摘要: public class Solution{ char[] c = s.toCharArray(); int len = c.length; if(len<=2){ System.out.println(c[len]); } int j=-1; for(int i=0;i<len-2;i++){ i 阅读全文
posted @ 2023-10-29 17:08 樱圃 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2023-10-29 16:46 樱圃 阅读(8) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页