![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 172 阅读 · 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 · 196 阅读 · 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 · 109 阅读 · 0 评论 -
Leetcode3.最长不重复子串
最长不重复子串题目分析代码代码运行过程个人总结题目给定一个字符串,找出不含有重复字符的最长子串的长度。示例 1:输入: "abcabcbb"输出: 3解释: 无重复字符的最长子串是 "abc",其长度为 3。示例 2:输入: "bbbbb"输出: 1解释: 无重复字符的最长子串是 "b",其长度为 1。示例 3:输入: "pwwkew"输出: 3解释: 无重复字符的...原创 2018-11-09 22:09:03 · 334 阅读 · 0 评论 -
Leetcode6.Z字形变换
题目给定一个字符串,找出不含有重复字符的最长子串的长度。示例 1:输入: s = "PAYPALISHIRING", numRows = 3输出: "PAHNAPLSIIGYIR"解释:P A H NA P L S I I GY I R示例 2:输入: s = "PAYPALISHIRING", numRows = 4输出: "PINALSI原创 2018-11-13 16:51:46 · 570 阅读 · 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 · 218 阅读 · 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 · 120 阅读 · 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 · 87 阅读 · 0 评论 -
Leetcode日记:49.错位词组队&哈希表相关操作
题目给定一个字符串数组,将字母异位词组合在一起。字母异位词指字母相同,但排列不同的字符串。示例:输入: ["eat", "tea", "tan", "ate", "nat", "bat"],输出:[ ["ate","eat","tea"], ["nat","tan"], ["bat"]]说明:所有输入均为小写字母。不考虑答案输出的顺序。问题分析题目中可以看出...原创 2019-04-22 16:55:26 · 130 阅读 · 0 评论