function unique (arr) { return Array.from(new Set(arr)) } var arr = [1,1,'true','true',true,true,15,15,false,false, undefined,undefined, null,null, Na ...
分类:
编程语言 时间:
2020-03-20 00:59:21
阅读次数:
71
一、题目说明 题目142. Linked List Cycle II,判断一个链表是否有环,如果有返回环的第一个元素,否则返回NULL。 这个题目是 141. Linked List Cycle 的升级版本,难度是Medium! 二、我的解答 最直观的解答就是用一个unordered_map dp来 ...
分类:
其他好文 时间:
2020-03-19 21:52:56
阅读次数:
71
a=["a","b","1","89","56","c"]foriinrange(len(a)):#获取列表长度以便索引foriiinrange(999):#定义数字最大数ifa[i]==str(ii):a[i]=int(a[i])print(a)
分类:
编程语言 时间:
2020-03-19 16:33:43
阅读次数:
91
思路跟51题一模一样 1 class Solution 2 { 3 vector<vector<string>> res; 4 vector<string> temp;//临时路径 5 vector<bool> col,m,s;//列,主对角线,副对角线 6 int n; 7 public: 8 i ...
分类:
其他好文 时间:
2020-03-18 23:52:55
阅读次数:
58
Given a string S, count the number of distinct, non-empty subsequences of S . Since the result may be large, return the answer modulo 10^9 + 7. Exampl ...
分类:
其他好文 时间:
2020-03-18 09:38:23
阅读次数:
52
题目地址:https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/ 题目描述 请定义一个队列并实现函数 max_value 得到队列里的最大值,要求函数max_value、push_back 和 pop_front 的均摊时间复杂度都是 ...
分类:
编程语言 时间:
2020-03-18 09:18:46
阅读次数:
69
IF ( SELECT COUNT(*) FROM sys.index_columns INNER JOIN sys.indexes ON indexes.index_id = index_columns.index_id AND indexes.object_id = index_columns. ...
分类:
数据库 时间:
2020-03-18 09:16:58
阅读次数:
83
1 class Solution 2 { 3 vector<vector<int>> res; 4 int sum = 0; 5 public: 6 void helper(vector<int>& nums, int start,int target, vector<int>& out) 7 { ...
分类:
其他好文 时间:
2020-03-17 23:55:47
阅读次数:
93
1 约束种类 约束名 | 约束关键字 : :|: : 主键|primary key 唯一|unique 非空|not null 外键|foreign key 检查约束|mysql不支持 2 主键约束 通常不使用业务字段(身份证,学号)作为主键,单独使用一个id作为主键,可以没意义,只要唯一,非空就行 ...
分类:
数据库 时间:
2020-03-16 09:16:30
阅读次数:
88
Q:假设你有一个数组,其中第i个元素是某只股票在第i天的价格。 如果你最多只能完成一笔交易(即买一股和卖一股股票),设计一个算法来求最大利润。 A:当前值比最小值小,代替最小值;当前值比最小值大,计算差值,和之前的差值做判断。 Q:假设你有一个数组,其中第i个元素表示某只股票在第i天的价格。 设计一 ...
分类:
其他好文 时间:
2020-03-15 22:02:24
阅读次数:
46