摘要:
Palindrome Linked List Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1: Input: head = [1,2,2,1 阅读全文
摘要:
Max Consecutive Ones Given a binary array nums, return the maximum number of consecutive 1's in the array. Example 1: Input: nums = [1,1,0,1,1,1] Outp 阅读全文
摘要:
Number of Segments in a String Given a string s, return the number of segments in the string. A segment is defined to be a contiguous sequence of non- 阅读全文
摘要:
Next Greater Element I The next greater element of some element x in an array is the first greater element that is to the right of x in the same array 阅读全文
摘要:
Longest Uncommon Subsequence I Given two strings a and b, return the length of the longest uncommon subsequence between a and b. If the longest uncomm 阅读全文
摘要:
Student Attendance Record I You are given a string s representing an attendance record for a student where each character signifies whether the studen 阅读全文
摘要:
Longest Palindrome Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built wi 阅读全文
摘要:
Reverse Vowels of a String Given a string s, reverse only all the vowels in the string and return it. The vowels are 'a', 'e', 'i', 'o', and 'u', and 阅读全文
摘要:
Maximum Average Subarray I You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is 阅读全文
摘要:
Binary Tree Tilt Given the root of a binary tree, return the sum of every tree node's tilt. The tilt of a tree node is the absolute difference between 阅读全文