摘要: class Solution { public double new21Game(int N, int K, int W) { // 先判断 K + W 是否小于N,如果是的话,说明肯定能赢得游戏,返回 1.0,也就是 100% if (N >= K + W) { return 1.0; } dou 阅读全文
posted @ 2020-07-23 22:21 Sexyomaru 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 方法一:利用归并排序保存位置数组,交换时交换位置数组 class Solution { int[] count; public List<Integer> countSmaller(int[] nums) { int n = nums.length; count = new int[n]; int[ 阅读全文
posted @ 2020-07-23 21:31 Sexyomaru 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 方法一:Map加双向链表 class LRUCache { class Node { public int key, val; Node pre,next; public Node() {} public Node(int k, int v) { key = k; val = v; } } priv 阅读全文
posted @ 2020-07-23 21:13 Sexyomaru 阅读(107) 评论(0) 推荐(0) 编辑