Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n ...
分类:
其他好文 时间:
2020-07-17 13:33:50
阅读次数:
46
数组 实现一个支持动态扩容的数组 实现一个大小固定的有序数组,支持动态增删改操作 实现两个有序数组合并为一个有序数组 总结:数组扩容优先考虑使用Array的静态方法Resize,其次考虑把一个扩容的、临时的数组赋值给原数组。 什么是数据结构? 数据结构是计算机存储、组织数据的方式; 在实际应用中,根 ...
分类:
编程语言 时间:
2020-07-17 11:38:06
阅读次数:
65
[A] 父子通信 1. 父组件与子组件之间是不能直接访问对方的数据的,需要通过相关方法实现通信 2. 实际中,通常需要数据从上往下传,即大组件(父组件)传到小组件(子组件)中, 比如:请求数据时一次性请求所有数据,请求到的返回值通过大组件传给小组件,然后进行计算和展示 3. 也需要数据从下往上传,即 ...
分类:
其他好文 时间:
2020-07-17 11:34:21
阅读次数:
60
package _interview_question /** * Check if a given array contains duplicate elements within k distance from each other. * Given an unsorted array that ...
分类:
其他好文 时间:
2020-07-17 01:23:35
阅读次数:
107
package LeetCode_279 import java.util.* import kotlin.collections.HashSet /** * 279. Perfect Squares * https://leetcode.com/problems/perfect-squares/d ...
分类:
其他好文 时间:
2020-07-17 01:15:12
阅读次数:
72
题目来源:leetcode33 搜索旋转排序数组 题目描述: 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] )。 搜索一个给定的目标值,如果数组中存在这个目标值,则返回它的索引,否则返回 -1 。 你 ...
分类:
编程语言 时间:
2020-07-16 21:36:36
阅读次数:
87
class AppendStatus{ successed = false; constructor(){ } success(listenEvent){ this.successed = true; if(listenEvent){ listenEvent.run(); } } getStatus ...
分类:
其他好文 时间:
2020-07-16 21:01:41
阅读次数:
55
Minimum Size Subarray Sum Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which th ...
分类:
其他好文 时间:
2020-07-16 18:17:25
阅读次数:
57
problem 1394. Find Lucky Integer in an Array solution #1: 使用哈希表; 使用哈希表记录数组元素和freq,然后判断是否相等,且取最大值; 注意 1. 最大值可以由下标一次递减隐性表示; 2. 数值的范围是1-500; 参考 1. leetco ...
分类:
其他好文 时间:
2020-07-16 00:22:19
阅读次数:
51
Given an array, rotate the array to the right by k steps, where k is non-negative. Follow up: Try to come up as many solutions as you can, there are a ...
分类:
其他好文 时间:
2020-07-16 00:20:51
阅读次数:
49