随笔分类 -  LeetCode

摘要:Description Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, jus 阅读全文
posted @ 2020-02-20 00:32 自由之翼Az 阅读(97) 评论(0) 推荐(0)
摘要:title: LeetCode——010 Regular Expression Matching author: zzw top: false toc: true mathjax: false email: 819342493@qq.com date: 2020 02 19 22:05:32 upd 阅读全文
posted @ 2020-02-20 00:30 自由之翼Az 阅读(136) 评论(0) 推荐(0)
摘要:Description Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: 阅读全文
posted @ 2020-02-20 00:29 自由之翼Az 阅读(91) 评论(0) 推荐(0)
摘要:Description Given a 32 bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Solution: 翻转一个带字符整数 最高数值为【 2^31 2^31 1】32位系统 阅读全文
posted @ 2020-02-20 00:27 自由之翼Az 阅读(86) 评论(0) 推荐(0)
摘要:Description Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 阅读全文
posted @ 2020-02-20 00:25 自由之翼Az 阅读(92) 评论(0) 推荐(0)
摘要:Description Given a string, find the length of the longest substring without repeating characters. Example 1: Example 2: Example 3: Solution: 使用unorde 阅读全文
posted @ 2020-02-20 00:24 自由之翼Az 阅读(81) 评论(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 contai 阅读全文
posted @ 2020-02-20 00:23 自由之翼Az 阅读(80) 评论(0) 推荐(0)
摘要:Description 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 input w 阅读全文
posted @ 2020-02-20 00:18 自由之翼Az 阅读(86) 评论(0) 推荐(0)
摘要:Description Given n non negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that 阅读全文
posted @ 2020-02-20 00:12 自由之翼Az 阅读(59) 评论(0) 推荐(0)
摘要:Description 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 c 阅读全文
posted @ 2019-12-30 23:24 自由之翼Az 阅读(172) 评论(0) 推荐(0)
摘要:Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
posted @ 2019-11-11 23:20 自由之翼Az 阅读(185) 评论(0) 推荐(0)
摘要:在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 如果你可以绕环路行驶一周,则返回出发时加油站的编号,否则返回 -1。 说 阅读全文
posted @ 2019-11-11 21:56 自由之翼Az 阅读(250) 评论(0) 推荐(0)
摘要:老师想给孩子们分发糖果,有 N 个孩子站成了一条直线,老师会根据每个孩子的表现,预先给他们评分。 你需要按照以下要求,帮助老师给这些孩子分发糖果: 每个孩子至少分配到 1 个糖果。相邻的孩子中,评分高的孩子必须获得更多的糖果。那么这样下来,老师至少需要准备多少颗糖果呢? 示例 1: 输入: [1,0 阅读全文
posted @ 2019-11-11 21:10 自由之翼Az 阅读(222) 评论(0) 推荐(0)
摘要:Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2019-11-06 23:34 自由之翼Az 阅读(170) 评论(0) 推荐(0)
摘要:Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Your al 阅读全文
posted @ 2019-11-06 23:28 自由之翼Az 阅读(187) 评论(0) 推荐(0)
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2019-11-06 22:53 自由之翼Az 阅读(333) 评论(0) 推荐(0)
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文
posted @ 2019-11-05 23:08 自由之翼Az 阅读(321) 评论(0) 推荐(0)
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is 阅读全文
posted @ 2019-11-02 23:25 自由之翼Az 阅读(191) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-11-02 22:28 自由之翼Az 阅读(205) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use 阅读全文
posted @ 2019-11-02 22:22 自由之翼Az 阅读(171) 评论(0) 推荐(0)