![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
阿团团
这个作者很懒,什么都没留下…
展开
-
LeetCode困难刷题记录——Reverse Nodes in k-Group K个一组翻转链表
问题:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the numbe...原创 2019-12-25 11:01:33 · 170 阅读 · 0 评论 -
LeetCode困难刷题记录——Merge k Sorted Lists 合并K个排序链表
问题:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并k个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。分析:这个题在困难里面算比较简单的吧。用二分法,两个两个合并,复杂度就是代码:/** *...原创 2019-12-19 13:42:26 · 127 阅读 · 0 评论 -
LeetCode困难刷题记录——Transform to Chessboard 变为棋盘
题目:An N x N board contains only 0s and 1s. In each move, you can swap any 2 rows with each other, or any 2 columns with each other.What is the minimum number of moves to transform the board into a...原创 2019-05-21 15:28:31 · 370 阅读 · 0 评论 -
LeetCode困难刷题记录——Max Points on a Line 直线上最多的点数
问题:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.给定一个二维平面,平面上有n个点,求最多有多少个点在同一条直线上。分析:根据两点确定一条直线原理,我们可以选取两个点确定一条直线,再看看其他的点有多少位于这条直线上,这题...原创 2019-05-22 16:20:15 · 191 阅读 · 0 评论 -
LeetCode困难刷题记录——Median of Two Sorted Arrays 寻找两个有序数组的中位数
问题:There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 ...原创 2019-05-31 15:16:16 · 244 阅读 · 0 评论 -
LeetCode困难刷题记录——Regular Expression Matching 正则表达式匹配
问题:Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.给你一个字符串s和一个字符规律p,请你来实现一个支持 '.'和'*'的正则表达式匹配。分析:其实这题没什么特殊的思路,很典型的动态规划题...原创 2019-06-19 16:01:25 · 388 阅读 · 0 评论