自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 Leetcode160 Intersection of 2 Linked List (Solved myself within 20 miniutes!!)

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:# Definition for singly-linked list.# class ListNode(object)...

2019-09-28 05:27:22 127

原创 LC234 Panlindrome Linked List

class Solution(object):def isPalindrome(self, head):“”":type head: ListNode:rtype: bool“”" # second method if not head or not head.next: return True# 1. Get the midpoint (slow)...

2019-09-27 18:46:59 187

原创 Leetcode 141: Linked List Cycle

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 position (0-indexed) in the linked list where tail con...

2019-09-27 16:12:25 135

原创 Leetcode 20 Valid Parentheses Use Stack

Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of bra...

2019-09-27 16:10:09 102

原创 Leetcode155 Min Stack use Python

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack.pop() – Removes the element on top of the stack.top() – Get the ...

2019-09-26 19:02:16 114

原创 LeetCode198 House Robber, Recursion and DP

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...

2019-09-26 18:13:46 152 1

原创 LC437 Path Sum III

Definition for a binary tree node.class TreeNode(object):def init(self, x):self.val = xself.left = Noneself.right = Noneclass Solution(object):def pathSum(self, root, sum):“”":type root: Tree...

2019-09-26 17:03:17 104

原创 LC101 Binary Tree check Symmetry

LC101 Binary Tree Symmetry几种方法:1)recursively compare two mirror trees, check if corresponding element is equal.2) Using Stacks,(use list to append and pop, not memory efficient; use collections.de...

2019-09-26 04:28:50 123

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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