
Leetcode
文章平均质量分 88
小鸭子Ori
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode日记:322.换硬币
题目 给定不同面额的硬币 coins 和一个总金额 amount。编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,返回 -1。 【举例】 输入: coins = [1, 2, 5], amount = 11 输出: 3 解释: 11 = 5 + 5 + 1 分析 我们仍采取上次说的回溯转动态规划,来慢慢熟悉动态规划解题思路。 回溯 public ...原创 2019-11-21 22:20:15 · 229 阅读 · 0 评论 -
Leetcode1.两数之和 Two Sum
1.两数之和(two sum)题目题目分析答案分析与总结哈希表的原理与数据结构c++中unordered_map的用法计划参考内容 题目 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 ...原创 2018-11-06 11:23:11 · 245 阅读 · 0 评论 -
Leetcode2.两数相加 Add Two Number
2.链表两数之和题目分析答案知识点总结哑结点 题目 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 th...原创 2018-11-06 19:01:17 · 161 阅读 · 0 评论 -
Leetcode3.最长不重复子串
最长不重复子串题目分析代码代码运行过程个人总结 题目 给定一个字符串,找出不含有重复字符的最长子串的长度。 示例 1: 输入: "abcabcbb" 输出: 3 解释: 无重复字符的最长子串是 "abc",其长度为 3。 示例 2: 输入: "bbbbb" 输出: 1 解释: 无重复字符的最长子串是 "b",其长度为 1。 示例 3: 输入: "pwwkew" 输出: 3 解释: 无重复字符的...原创 2018-11-09 22:09:03 · 405 阅读 · 0 评论 -
Leetcode6.Z字形变换
题目 给定一个字符串,找出不含有重复字符的最长子串的长度。 示例 1: 输入: s = "PAYPALISHIRING", numRows = 3 输出: "PAHNAPLSIIGYIR" 解释: P A H N A P L S I I G Y I R 示例 2: 输入: s = "PAYPALISHIRING", numRows = 4输出: "PINALSI原创 2018-11-13 16:51:46 · 663 阅读 · 0 评论 -
Leetcode日记:46&47.排列组合与回溯(backtrack)
Leetcode日记:46&47.排列组合与回溯(backtrack) 46排列组合1 题目 Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3...原创 2019-03-19 16:52:14 · 277 阅读 · 0 评论 -
Leetcode日记:51&52.N皇后问题
Leetcode日记:51&52.N皇后问题 题目 The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions ...原创 2019-03-26 09:59:24 · 158 阅读 · 0 评论 -
Leetcode日记:19&24&84.链表相关操作
Leetcode日记:19&24&84.链表相关操作 19.删除倒数第N个元素 19题目 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list: 1->2->3->4->5, and n = ...原创 2019-04-09 15:09:09 · 130 阅读 · 0 评论 -
Leetcode日记:49.错位词组队&哈希表相关操作
题目 给定一个字符串数组,将字母异位词组合在一起。字母异位词指字母相同,但排列不同的字符串。 示例: 输入: ["eat", "tea", "tan", "ate", "nat", "bat"], 输出: [ ["ate","eat","tea"], ["nat","tan"], ["bat"] ] 说明: 所有输入均为小写字母。 不考虑答案输出的顺序。 问题分析 题目中可以看出...原创 2019-04-22 16:55:26 · 215 阅读 · 0 评论