题目描述 Given a string containing just the characters ‘(‘ and ‘)’, find the length of the…
标签:LeetCode
LeetCode算法代码笔记(1-5)
给自己的目标:[LeetCode](https://leetcode.com/ "Online Judge Platform") 上每日一题 在做题的过程中记录下解题的思路或者重要的代码碎片以便后来翻阅。 项目源码:gi…
【leetcode】- Binary Subarrays With Sum(二进制子数组的和问题)
1、题目描述 In an array A of 0s and 1s, how many non-empty subarrays have sum S? Example 1: Input: A = [1,0,1,0,1],…
Remove Substrings
Difficulty : Medium Given a string s and a set of n substrings. You are supposed to remove every instance of t…
Leetcode394——Decode String
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书 1. 问题描述 Given an encoded string, return it̵…
[array] leetCode-16. 3Sum Closest -Medium
16. 3Sum Closest -Medium descrition Given an array S of n integers, find three integers in S such that the sum…
Leetcode3——Longest Substring Without Repeating Characters
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书 1. 问题描述 Given a string, find the length of the …
547. Friend Circles (如何处理棋盘类型的问题)
一个典型的棋盘问题都是带有一个矩阵的,例如: Input: [[1,1,0], [1,1,0], [0,0,1]] 棋盘类型的问题最麻烦的部分是查询每个点的相邻点的时候并不复杂,但是难以简化,条件众多,导致代码可读性变差…
二刷78. Subsets
Medium 应该可以秒的,但是i+1那里一开始写成了index+1 class Solution { public List<List<Integer>> subsets(int[] nums)…
LeetCode[18] - Binary Search Tree Iterator
李特这的这个题目不错。写一遍example就能看出来inorder traversal。当然啦,不能直接全部traverse了,因为题目说有空间限制。 那么就traversal on the fly, 先左手DFS, 然…
LeetCode刷题之Merge Two Sorted Lists
Problem Merge two sorted linked lists and return it as a new list. The new list should be made by splicing tog…
leetcode讲解--94. Binary Tree Inorder Traversal
94. Binary Tree Inorder Traversal Given a binary tree, return the inorder traversal of its nodes’ values…