[USACO17DEC]Standing Out from the Herd 题目描述 Just like humans, cows often appreciate feeling they are unique in some way. Since Farmer John's cows all ...
分类:
其他好文 时间:
2020-02-06 19:30:04
阅读次数:
81
用了一个字典 class Solution: def firstUniqChar(self, s: str) -> int: charIndexDict = {} for i in range(len(s)): if s[i] in charIndexDict: charIndexDict[s[i] ...
分类:
其他好文 时间:
2020-02-05 21:51:17
阅读次数:
62
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s ...
分类:
其他好文 时间:
2020-02-05 17:58:35
阅读次数:
87
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
题目链接: "http://poj.org/problem?id=1679" 题目大意: 给你一个简单连通图,判断他的最小生成树是否唯一。 解题思路: 首先(我这里用Kruskal算法)求出它的最小生成树(以下简称MST)以及对应的边,然后构造出这棵MST。 然后我们枚举图上每一条不在此MST上的边 ...
分类:
其他好文 时间:
2020-02-02 19:56:59
阅读次数:
91
01 索引类型 索引类型分为 NORMAL:这是最基本的索引,它没有任何限制,默认的BTREE类型的索引,是我们大多数情况下用到的索引。 UNIQUE:表示唯一的,不允许重复的索引,如果该字段信息保证不会重复。例如身份证号用作索引时,可设置为unique。Unique(要求列唯一)和Primary ...
分类:
数据库 时间:
2020-02-02 15:32:21
阅读次数:
112
1 """ 2 We are given head, the head node of a linked list containing unique integer values. 3 4 We are also given the list G, a subset of the values i ...
分类:
其他好文 时间:
2020-02-01 23:05:58
阅读次数:
64
六大约束: NOT NULL (非空) DEFAULT (默认) UNIQUE (唯一) 【唯一约束可以为空值,但是不能重复】 CHECK (检查)【mysql不起作用】 PRIMARY KEY (主键)【主键约束不能为空值,也不能重复】 FOREIGN KEY (外键) 约束一般分为列级约束和表级 ...
分类:
数据库 时间:
2020-02-01 14:26:49
阅读次数:
483
60. Permutation Sequence The set contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the foll ...
分类:
其他好文 时间:
2020-01-31 12:36:55
阅读次数:
63
ALTER TABLE `dbname`.`tablename` MODIFY COLUMN `userid` int(11) UNIQUE 设置为唯一值,并且允许为空,如果为空,不计算在约束内,就是可以多个为空 ...
分类:
其他好文 时间:
2020-01-31 10:37:45
阅读次数:
80