标签:LeetCode
持续更新中(* ॑ᐜ ॑*)(* ॑ᐜ ॑*) Sliding Window (滑动窗口) 寻找符合条件的最短子字符串——SLIDING WINDOW Backtracking (回溯法) 数组排列组合问题——BACKTRACKING Dynamic
leetcode第二题 题目: 给定两个非空链表来表示两个非负整数。位数按照逆序方式存储,它们的每个节点只存储单个数字。将两数相加返回一个新的链表。 你可以假设除了数字 0 之外,这两个数字都不会以零开头。 源码(使用Java语言) /** * Definition for singly-lin
这是LeetCode里的第25道题。 题目要求: 给出一个链表,每 k 个节点一组进行翻转,并返回翻转后的链表。 k 是一个正整数,它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍,那么将最后剩余节点保持原有顺序。 示例 : 给定这个链表:1->2->3->4->
Add Digits 题目描述: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the p
Description Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input w
Description You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their
Description Write a function to find the longest common prefix string amongst an array of strings. 思路 最长的公共前缀,所以,先找出前两个的最长前缀,然后再和后面的比,在比的过程中,记录最小的串的长度
Description Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 思路 这个也没啥好说的吧,首先搞清楚罗马数字是个什么鬼? 基
Description Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 思路 这个也没啥好说的吧,首先搞清楚罗马数字是个什么鬼? 基
Description Determine whether an integer is a palindrome. Do this without extra space. Example Some hints: Could negative integers be palindromes? (ie
Description Reverse digits of an integer. Example Example1: x = 123, return 321 Example2: x = -123, return -321 Note: The input is assumed to be a 32
Description The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a