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
Queue简介 queue是队列容器,是一种“先进先出”的容器。 queue是简单地装饰deque容器而成为另外的一种容器。 #include<queue> queue对象的默认构造 queue采用模板类实现 queue<T> queT; //queue对象的默认构造形式: queue<int> q ...
分类:
其他好文 时间:
2020-07-16 18:14:32
阅读次数:
59
最大值优先级队列、最小值优先级队列 优先级队列适配器 STL priority_queue 用来开发一些特殊的应用 priority_queue<int, deque> pq; priority_queue<int, vector>pq; pq.empty() pq.size() pq.top() ...
分类:
其他好文 时间:
2020-07-16 18:13:43
阅读次数:
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
在工作中,以前的枚举类都做的比较简单,直到与公司的一个大佬合作做项目时,看到了一个更加通用且全面的通用枚举类。 且更符合阿里巴巴的java技术规范,特此记录 以上引用自阿里巴巴Java开发手册1.4.0 主要特点如下: 枚举提供序号、值、注释信息 提供构造器和get set方法 提供转换列表的方法, ...
分类:
其他好文 时间:
2020-07-16 00:19:58
阅读次数:
112
<%@page import="java.util.HashMap"%> <%@page import="java.util.Map"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UT ...
分类:
编程语言 时间:
2020-07-16 00:15:45
阅读次数:
90