- 博客(16)
- 资源 (1)
- 收藏
- 关注
原创 Week 15 Length of Last Word
问题概述Given a string s consists of upper/lower-case alphabets and empty space characters ’ ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is de...
2018-12-27 21:48:42 69
原创 Project
Capacitated Facility Location Problem问题描述Submission算法设计结果问题描述Suppose there are n facilities and m customers. We wishto choose:(1) which of the n facilities to open(2) the assignment of customers...
2018-12-26 20:09:12 101
原创 Week 14 Min Stack
155.Min Stack问题概述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 sta...
2018-12-09 18:14:40 91
原创 Week 13 Unique Paths
62.Unique Paths问题概述A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is tr...
2018-12-02 19:07:40 81
原创 Week 12 Binary Tree Inorder Traversal
94.Binary Tree Inorder Traversal问题概述Given a binary tree, return the inorder traversal of its nodes’ values.ExampleInput: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]分析二叉树遍历:前序遍历:...
2018-11-25 21:02:28 66
原创 Week 11 Best Time to Buy and Sell Stock with Cooldown
309.Best Time to Buy and Sell Stock with Cooldown问题概述Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may c...
2018-11-18 21:54:52 115
原创 Week 10 Minimum Path Sum
64. Minimum Path Sum问题概述Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move ...
2018-11-11 20:34:53 88
原创 Week 9 Remove Duplicates From Sorted List
83. Remove Duplicates From Sorted List问题概述Given a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input...
2018-11-04 18:41:32 65
原创 Week 8 Remove Nth Node From End of List
19.Remove Nth Node From End of List问题概述Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After rem...
2018-10-28 18:36:52 79
原创 Week 7 Generate Parentheses
22. Generate Parentheses问题概述Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[“((()))”,“(()())”,...
2018-10-21 21:14:15 62
原创 Week 6 Construct Binary Tree from Preorder and Inorder Traversal
105. Construct Binary Tree from Preorder and Inorder Traversal问题概述Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the ...
2018-10-15 15:26:05 115
原创 Week 5 Count and Say
38. Count and Say问题概述The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as “one 1” or 1111 is read...
2018-10-13 23:11:19 68
翻译 Week 4 Regular Expression Matching
10.Regular Expression Matching问题概述Given an input string (s) and a pattern §, implement regular expression matching with support for ‘.’ and ‘*’.'.' Matches any single character.'*' Matches zero or...
2018-09-30 17:13:09 60
原创 Week3 Same Tree
100.Same Tree问题描述题目来自LeetCode Depth-first SearchGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally iden...
2018-09-28 17:11:37 111
原创 week 2 Add Two Numbers
2. Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two ...
2018-09-15 21:33:33 82
原创 week 1 Search Insert Position
Search Insert Position题目来自leetcode Array部分 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order....
2018-09-08 11:34:48 105
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人