摘要: 2262. Total Appeal of A String Hard The appeal of a string is the number of distinct characters found in the string. For example, the appeal of "abbca 阅读全文
posted @ 2022-06-27 07:03 xiaoyongyong 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 785. Is Graph Bipartite? Medium 4979279Add to ListShare There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. Yo 阅读全文
posted @ 2022-06-27 06:45 xiaoyongyong 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1057. Campus Bikes Medium On a campus represented on the X-Y plane, there are n workers and m bikes, with n <= m. You are given an array workers of le 阅读全文
posted @ 2022-06-27 06:42 xiaoyongyong 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 881. Boats to Save People Medium You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where 阅读全文
posted @ 2022-06-27 05:59 xiaoyongyong 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 31. Next Permutation Medium A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for a 阅读全文
posted @ 2022-06-19 02:52 xiaoyongyong 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 1570. Dot Product of Two Sparse Vectors Medium 858114Add to ListShare Given two sparse vectors, compute their dot product. Implement class SparseVecto 阅读全文
posted @ 2022-06-19 01:22 xiaoyongyong 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 214. Shortest Palindrome Hard You are given a string s. You can convert s to a palindrome by adding characters in front of it. Return the shortest pal 阅读全文
posted @ 2022-06-13 02:31 xiaoyongyong 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 2116. Check if a Parentheses String Can Be Valid Medium A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any  阅读全文
posted @ 2022-06-06 08:19 xiaoyongyong 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 318. Maximum Product of Word Lengths Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do 阅读全文
posted @ 2022-05-30 00:47 xiaoyongyong 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 定义set emptySet = set() mySet = {'a','b','c'} tuple, 与list类似,但是是immutable的 如果你将一个list添加到set,就会报错;但是如果你将tuple添加到set是ok的,因为tuple 不可改变因此它的hash值是固定的 alist 阅读全文
posted @ 2022-05-16 06:16 xiaoyongyong 阅读(12) 评论(0) 推荐(0) 编辑