Jasmine_dream

Machine learning , NLP

leetcode 225 Implement Stack using Queues 用队列实现栈 python 双队列

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop...

2019-04-20 10:23:38

阅读数 23

评论数 0

leetcode 232 Implement Queue using Stacks 用栈实现队列 python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Implement the following operations of a queue using stacks. push(x) -- Push element x to the back o...

2019-04-19 22:42:05

阅读数 16

评论数 0

leetcode 120 Triangle 三角形最小路径和 python 动规

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent num...

2019-04-10 10:11:21

阅读数 31

评论数 0

leetcode 096 Unique Binary Search Trees 不同的二叉搜索树 python 动规 , 最简代码

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Exa...

2019-04-09 16:33:49

阅读数 32

评论数 0

leetcode 859 亲密字符串 Buddy Strings python 多种解法,最简代码

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in ...

2019-04-09 14:41:57

阅读数 42

评论数 0

leetcode 064 Minimum Path Sum 最小路径和 python 动规

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which m...

2019-04-09 14:25:52

阅读数 26

评论数 0

leetcode 072 Edit Distance 编辑距离 python 动规

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ‘’’ Given two words word1 and word2, find the minimum number of operations required to convert word1 to wo...

2019-04-09 14:23:55

阅读数 51

评论数 0

leetcode 877 Stone Game 石子游戏 python 动规

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ‘’’ Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, a...

2019-04-09 14:22:26

阅读数 77

评论数 0

leetcode 112 Path Sum 路径总和 python 最简代码

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all ...

2019-03-28 09:06:07

阅读数 64

评论数 0

leetcode 003 Longest Substring Without Repeating Characters 无重复字符的最长子串 python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a string, find the length of the longest substring without repeating characters. Example 1: I...

2019-03-21 16:42:59

阅读数 25

评论数 0

leetcode 138 复制带随机指针的链表 Copy List with Random Pointer python O(n) O(1)

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' A linked list is given such that each node contains an additional random pointer which could point ...

2019-03-20 21:01:37

阅读数 49

评论数 0

leetcode 430 Flatten a Multilevel Doubly Linked List 扁平化多级双向链表 python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' You are given a doubly linked list which in addition to the next and previous pointers, it could have...

2019-03-20 16:15:08

阅读数 51

评论数 0

leetcode 061 旋转链表 Rotate List python 前后指针定位

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: ...

2019-03-20 15:35:21

阅读数 23

评论数 0

leetcode 328 奇偶链表 Odd Even Linked List python 前后指针

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here...

2019-03-20 10:59:54

阅读数 41

评论数 0

leetcode 203 Remove Linked List Elements 移除链表元素 python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Remove all elements from a linked list of integers that have value val. Example: Input: 1->...

2019-03-20 10:30:00

阅读数 134

评论数 0

leetode 142 Linked List Cycle II 环形链表 II python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To r...

2019-03-19 17:00:52

阅读数 41

评论数 0

leetcode 707 设计链表 Design Linked List python(list 构造)

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Design your implementation of the linked list. You can choose to use the singly linked list or the d...

2019-03-19 15:33:37

阅读数 118

评论数 0

leetcode 043 字符串相乘 Multiply Strings python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and...

2019-03-17 22:56:33

阅读数 26

评论数 0

leetcode 002 两数相加 Add Two Numbers python

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' You are given two non-empty linked lists representing two non-negative integers. The digits are stor...

2019-03-17 10:12:32

阅读数 20

评论数 0

leetcode 059 Spiral Matrix II 螺旋矩阵 II python 最高效解

所有Leetcode题目不定期汇总在 Github, 欢迎大家批评指正,讨论交流。 ''' Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order...

2019-03-16 19:41:12

阅读数 33

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭