import java.util.ArrayList; import java.util.List; import org.junit.Test; /** * 判断重复的数据 * @author YangKai * */ public class Demo { @Test public void a () { List<Integer> list = new ArrayList<Integer>(); List<Integer> list2 = new ArrayLis
我现在在做一个叫<leetbook>的免费开源书项目,力求提供最易懂的中文思路,目前把解题思路都同步更新到gitbook上了,需要的同学可以去看看 书的地址:https://hk029.gitbooks.io/leetbook/ 003. Longest Substring Without Repeating Characters[M] Longest Substring Without Repeating CharactersM 题目 思路 代码 题目 Given a string, fin
public class Demo { /** * 去掉重复值 */ public static void main(String[] args) { String test = "100,120,166,1555,120,150,100"; String[] test1 = test.split(","); ArrayList list = new ArrayList(); for (int i = 0; i < test1.length; i++) { i
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab". Return 3, because by repeating A three
判断字段id和字段zhi重复的条数 group by 和having 解释:前提必须了解sql语言中一种特殊的函数:聚合函数,--例如SUM, COUNT, MAX, AVG等.这些函数和其它函数的根本区别就是它们一般作用在多条记录上. --WHERE关键字在使用集合函数时不能使用,所以在集合函数中加上了HAVING来起到测试查询结果是否符合条件的作用. create TABLE Table1 ( ID int identity(1,1) primary key NOT NU
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab". Return 3, because by repeating A three
1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2.删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录delete from people where peopleId
[抄题]: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string. Example 1: Input:s1 = "ab" s2 = "eidbaooo