leetcode
砖业洋__
掘金/InfoQ签约作者,阿里云/51CTO专家博主,华为云·云享专家,CSDN博客专家,腾讯云·2023年度影响力创作者/优质共创者,擅长MySQL和Java领域,技术分享,全网同名———砖业洋__
展开
-
541. Reverse String II(反转字符串 II)
题目地址:https://leetcode.com/problems/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 st...原创 2018-05-10 21:54:09 · 6971 阅读 · 0 评论 -
142. Linked List Cycle II(环形链表2,找到环的入口点并且推理验证)
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can you solve it without using extra space? 给定一个链表,返回...原创 2018-10-21 13:57:24 · 808 阅读 · 0 评论 -
2. Add Two Numbers(链表尾插法)
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...原创 2018-09-22 21:20:07 · 472 阅读 · 0 评论 -
141. Linked List Cycle(环形链表,判断链表中是否有环存在)
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 给定一个链表,判断链表中是否有环。 进阶: 你能否不使用额外空间解决此题? =================================== 更进一步...原创 2018-10-21 12:33:36 · 474 阅读 · 0 评论 -
11. Container With Most Wate(盛最多水的容器)
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two...原创 2018-10-08 11:20:50 · 345 阅读 · 0 评论 -
9. Palindrome Number(回文数)
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Expl...原创 2018-10-01 20:15:11 · 184 阅读 · 0 评论 -
3. Longest Substring Without Repeating Characters(无重复字符的最长子串)
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: ...原创 2018-09-13 13:03:16 · 257 阅读 · 0 评论 -
448. Find All Numbers Disappeared in an Array(找到所有数组中消失的数字)
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array. Coul...原创 2018-09-13 12:09:27 · 274 阅读 · 0 评论 -
198. House Robber(打家劫舍)(求不相邻的位置上的数字之和的最大值)
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...原创 2018-09-04 20:47:40 · 331 阅读 · 0 评论 -
144. Binary Tree Preorder Traversal(二叉树的前序遍历)
题目地址:https://leetcode.com/problems/binary-tree-preorder-traversal/description/ Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ ...原创 2018-05-24 20:58:12 · 6125 阅读 · 0 评论 -
290. Word Pattern(单词模式)(Integer的坑)
题目地址:https://leetcode.com/problems/word-pattern/description/ Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection be...原创 2018-05-22 23:06:04 · 6766 阅读 · 0 评论 -
268. Missing Number(缺失数字)
题目地址:https://leetcode.com/problems/missing-number/description/ Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Inpu...原创 2018-05-22 16:22:46 · 6509 阅读 · 0 评论 -
572. Subtree of Another Tree(另一个树的子树)
题目地址:https://leetcode.com/problems/subtree-of-another-tree/description/ Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of...原创 2018-05-07 17:06:39 · 7214 阅读 · 0 评论 -
441. Arranging Coins(排列硬币)(可用二分搜索)
题目地址:https://leetcode.com/problems/arranging-coins/description/ You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find ...原创 2018-05-06 09:54:01 · 7307 阅读 · 0 评论 -
67. Add Binary(二进制求和)
题目地址:https://leetcode.com/problems/add-binary/description/ Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0...原创 2018-05-05 21:29:55 · 6843 阅读 · 0 评论 -
58. Length of Last Word(最后一个单词的长度)
题目地址:https://leetcode.com/problems/length-of-last-word/description/ Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the strin...原创 2018-05-05 20:34:55 · 6851 阅读 · 0 评论 -
724. Find Pivot Index(寻找数组的中心索引)
题目地址:https://leetcode.com/problems/find-pivot-index/description/ Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index ...原创 2018-05-05 20:21:33 · 6957 阅读 · 0 评论