随笔分类 -  Leetcode

Leetcode题解
摘要:题目 Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. 给定一棵 阅读全文
posted @ 2020-04-22 11:03 陌良 阅读(134) 评论(0) 推荐(0)
摘要:题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 For example, two is written as 阅读全文
posted @ 2020-04-21 23:13 陌良 阅读(162) 评论(0) 推荐(0)
摘要:题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 For example, two is written as 阅读全文
posted @ 2020-04-21 18:24 陌良 阅读(136) 评论(0) 推荐(0)
摘要:题目 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 e 阅读全文
posted @ 2020-04-21 17:13 陌良 阅读(143) 评论(0) 推荐(0)
摘要:题目 Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it. Return the number of nice sub arrays. 阅读全文
posted @ 2020-04-21 13:58 陌良 阅读(236) 评论(0) 推荐(0)
摘要:题目 Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adja 阅读全文
posted @ 2020-04-20 23:10 陌良 阅读(141) 评论(0) 推荐(0)
摘要:题目 给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 ' ' 的正则表达式匹配。 所谓匹配,是要涵盖 整个 字符串 s的,而不是部分字符串。 Example1 Example2 Example3 Example4 Example5 来源:力扣(LeetCode) 链接:htt 阅读全文
posted @ 2020-04-17 19:20 陌良 阅读(168) 评论(0) 推荐(0)
摘要:题目 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Follow up: Coud you solve it w 阅读全文
posted @ 2020-04-17 15:15 陌良 阅读(128) 评论(0) 推荐(0)
摘要:题目 Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non wh 阅读全文
posted @ 2020-04-17 14:41 陌良 阅读(141) 评论(0) 推荐(0)
摘要:题目 Given an array of non negative integers, you are initially positioned at the first index of the array. Each element in the array represents your ma 阅读全文
posted @ 2020-04-17 11:00 陌良 阅读(140) 评论(0) 推荐(0)
摘要:题目 Given a 32 bit signed integer, reverse digits of an integer. Assume we are dealing with an environment which could only store integers within the 3 阅读全文
posted @ 2020-04-16 12:54 陌良 阅读(147) 评论(0) 推荐(0)
摘要:题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed fo 阅读全文
posted @ 2020-04-16 12:04 陌良 阅读(161) 评论(0) 推荐(0)
摘要:题目 Given a collection of intervals, merge all overlapping intervals. 给出一个区间的集合,请合并所有重叠的区间。 Example1 Example2 来源:力扣(LeetCode) 链接:https://leetcode.com/p 阅读全文
posted @ 2020-04-16 10:51 陌良 阅读(138) 评论(0) 推荐(0)
摘要:题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 阅读全文
posted @ 2020-04-15 17:32 陌良 阅读(110) 评论(0) 推荐(0)
摘要:1-500 1-100 【简单】1-两数之和 Two Sum 【中等】2-两数相加 Add Two Num 【中等】3-无重复字符的最长子串 Longest Substring Without Repeating Characters 【困难】4-寻找两个有序数组的中位数 Median of Two 阅读全文
posted @ 2020-04-15 15:03 陌良 阅读(154) 评论(0) 推荐(0)
摘要:题目 Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. 1. The number o 阅读全文
posted @ 2020-04-15 14:28 陌良 阅读(485) 评论(0) 推荐(0)
摘要:题目 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 con 阅读全文
posted @ 2020-04-14 18:04 陌良 阅读(488) 评论(0) 推荐(0)
摘要:题目 Given a string, find the length of the longest substring without repeating characters. 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 Example1 Example2 Example3 阅读全文
posted @ 2020-04-14 17:17 陌良 阅读(160) 评论(0) 推荐(0)
摘要:题目重述 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 complexi 阅读全文
posted @ 2020-04-14 14:57 陌良 阅读(104) 评论(0) 推荐(0)
摘要:题目重述 You are given two non empty linked lists representing two non negative integers. The most significant digit comes first and each of their nodes c 阅读全文
posted @ 2020-04-14 14:52 陌良 阅读(143) 评论(0) 推荐(0)