two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific targ…
标签:LeetCode
LeetCode | Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in&nb…
LeetCode Math算法题(Easy级别)整理 Part 1
7. Reverse Integer 题目简介:翻转一个数字的数字部分的字符,即负数的“-”位置不变,只翻转数字部分。当翻转后的数字溢出时(超过32有符号整数的范围),返回0。 解题思路:将数字转成字符串,利用字符串的翻…
LeetCode-Problem 6:字符串Z字形回转
实现一个将字符串进行指定行数的转换的函数: 将字符串 “PAYPALISHIRING” 以Z字形排列成给定的行数:(下面这样的形状) 之后按逐行顺序依次排列:”PAHNAPLSIIGYIR” P A H N A P L …
LeetCode | Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into…
LeetCode | Binary Search Tree Iterator
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of…
LeetCode解题报告--Merge Two Sorted Lists
**题目:**Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should b…
LeetCode解题报告--Valid Parentheses
**题目:**Valid Parentheses Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determ…
leetcode笔记:Remove Duplicate Letters
一. 题目描述 Given a string which contains only lowercase letters, remove duplicate letters so that every letter ap…
leetcode笔记:House Robber III
一. 题目描述 The thief has found himself a new place for his thievery again. There is only one entrance to this are…
LeetCode 21 Merge Two Sorted Lists 把两个链表有序连接
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing togethe…
[LeetCode] 32. Longest Valid Parentheses
最长有效括号 1. 题目描述: 给定一个只包含 '(' 和 ')' 的字符串,找出最长的包含有效括号的子串的长度。 示例1: 输入: "(()" 输出: 2 解释: 最长有效括号子串为 "()" 示例…