https://leetcode-cn.com/problems/add-two-numbers/ ListNode root = new ListNode(0); ListNode cur = root; int retain = 0; while (l1!=null || l2!=null || ...
分类:
其他好文 时间:
2020-02-05 20:18:39
阅读次数:
70
int [] two_num(int [] nums,int target){ HashMap<Integer, Integer> num_indx = new HashMap<Integer, Integer>(); int [] ans = new int [2]; for(int i=0;i< ...
分类:
其他好文 时间:
2020-02-05 18:42:01
阅读次数:
60
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2020-02-05 13:35:52
阅读次数:
62
STEP ONE:设计游戏规则。 作为一个合格的游戏,我们肯定要设计一个合理的游戏规则。 以下是我的方案: 得分=已固定的方块数*1+已消除的行数*50 方块掉落速度=1+已消除的行数*0.05 方块下落的时间间隔=500/方块掉落速度 ok! STEP TWO:ui实现。 这一步我们放在Index ...
分类:
Web程序 时间:
2020-02-05 13:25:30
阅读次数:
133
向下转型: 子类引用指向父类对象,此处必须强制转换,可以调用子类特有方法。例: Animal two = new Cat(); Cat temp = (Cat)two; 若满足转型条件时才能进行强转。 判断一个对象是否是某个类的实例: ...
分类:
编程语言 时间:
2020-02-05 10:04:26
阅读次数:
82
https://leetcode cn.com/problems/merge k sorted lists/ 这道题的前置题目是合并两个排序链表 https://leetcode cn.com/problems/merge two sorted lists/ 1. 暴力法 将所有链表合并后排序 时间 ...
分类:
编程语言 时间:
2020-02-04 10:50:02
阅读次数:
56
Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + ...
分类:
其他好文 时间:
2020-02-04 10:47:17
阅读次数:
71
Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2] Example 2: Input: num ...
分类:
其他好文 时间:
2020-02-04 10:34:46
阅读次数:
61
POJ 3579 Median 二分+思维 题意 给你一些数,然后求这些数相互之间差的绝对值,然后绝对值排序,找到中间那个数。 解题思路 我反正一直开始是没有想到这个题竟然可以用二分来做。━━( ̄ー ̄ |||━━. 二分枚举答案,假设枚举值为 ,然后就是在排好序的序列中对每一个 找到在 之后,有多少 ...
分类:
其他好文 时间:
2020-02-04 00:55:03
阅读次数:
73
题目内容 Given two non negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example: ...
分类:
其他好文 时间:
2020-02-03 22:31:16
阅读次数:
81