随笔分类 - 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. 给定一棵
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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.
阅读全文
摘要:题目 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
阅读全文
摘要:题目 给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 ' ' 的正则表达式匹配。 所谓匹配,是要涵盖 整个 字符串 s的,而不是部分字符串。 Example1 Example2 Example3 Example4 Example5 来源:力扣(LeetCode) 链接:htt
阅读全文
摘要:题目 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
阅读全文
摘要:题目 Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non wh
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 Given a collection of intervals, merge all overlapping intervals. 给出一个区间的集合,请合并所有重叠的区间。 Example1 Example2 来源:力扣(LeetCode) 链接:https://leetcode.com/p
阅读全文
摘要:题目 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
阅读全文
摘要:1-500 1-100 【简单】1-两数之和 Two Sum 【中等】2-两数相加 Add Two Num 【中等】3-无重复字符的最长子串 Longest Substring Without Repeating Characters 【困难】4-寻找两个有序数组的中位数 Median of Two
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 Given a string, find the length of the longest substring without repeating characters. 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 Example1 Example2 Example3
阅读全文
摘要:题目重述 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
阅读全文
摘要:题目重述 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
阅读全文

浙公网安备 33010602011771号