![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 71
quliuwuyihmy
这个作者很懒,什么都没留下…
展开
-
LeetCode-383. Ransom Note
问题描述 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines原创 2017-07-22 14:43:59 · 356 阅读 · 0 评论 -
Leetcode-4. Median of Two Sorted Arrays
Description There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1: nums1原创 2017-07-25 20:47:09 · 429 阅读 · 0 评论 -
LeetCode- 3. Longest Substring Without Repeating Characters
Description Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”原创 2017-07-24 20:11:02 · 304 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-24 08:18:24 · 270 阅读 · 0 评论 -
LeetCode-551. Student Attendance Record I
Description You are given a string representing an attendance record for a student. The record only contains the following three characters:‘A’ : Absent. ‘L’ : Late. ‘P’ : Present. A student could原创 2017-07-24 08:18:01 · 279 阅读 · 0 评论 -
LeetCode-521. Longest Uncommon Subsequence I
Description Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defined as the longest subsequence of one原创 2017-07-24 08:17:38 · 242 阅读 · 0 评论 -
LeetCode-344. Reverse String
LeetCode-344. Reverse StringDescription Write a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”.题目分析 本题要求返回所给字符串的逆序字符串。解决方法是直接逆序复制字符串原创 2017-07-24 08:17:07 · 214 阅读 · 0 评论 -
LeetCode-345. Reverse Vowels of a String
DescriptionWrite a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Example 2: Given s = “leetcode”, return “leotcede”.Note:原创 2017-07-24 08:16:30 · 362 阅读 · 0 评论 -
LeetCode-541. Reverse String II
Description Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse原创 2017-07-24 08:15:45 · 326 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-24 08:14:25 · 205 阅读 · 0 评论 -
LeetCode- 125. Valid Palindrome
DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is原创 2017-07-23 11:33:32 · 223 阅读 · 0 评论 -
LeetCode-459. Repeated Substring Pattern
Description Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of low原创 2017-07-22 22:40:59 · 241 阅读 · 0 评论 -
字符指针与字符数组
字符指针定义及初始化: char *strs="Hello,world!"char *strs;str = "Hello,world!";字符串中的所有字符在内存中是连续排列的,strs指向的是字符串的第0个字符(从零开始);我们通常将第0个字符的地址称为字符串的首地址。字符串中每个字符的类型都是char,所以 str 的类型也必须是char *。访问方法:printf("%s\n",strs)原创 2017-07-22 14:45:46 · 458 阅读 · 0 评论 -
LertCode- 27. Remove Element
Description Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant mem原创 2017-07-26 10:57:05 · 494 阅读 · 0 评论