摘要: 题目描述 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 阅读全文
posted @ 2019-10-05 19:40 schaffen 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The an 阅读全文
posted @ 2019-10-03 17:02 schaffen 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述 144. Binary Tree Preorder Traversal 94. Binary Tree Inorder Traversal 145. Binary Tree Postorder Traversal 前序排列 :根-左-右 中序排列: 左-根-右 后序排列:左-右-根 参考答 阅读全文
posted @ 2019-10-02 23:28 schaffen 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assum 阅读全文
posted @ 2019-10-02 01:11 schaffen 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need 阅读全文
posted @ 2019-09-30 22:12 schaffen 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目介绍 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 would ha 阅读全文
posted @ 2019-09-30 19:05 schaffen 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive i 阅读全文
posted @ 2019-09-30 00:07 schaffen 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [9,4] 阅读全文
posted @ 2019-09-29 23:24 schaffen 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets 阅读全文
posted @ 2019-09-26 00:00 schaffen 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Given a binary tree, return the inorder traversal of its nodes' values. (左 - 根 - 右) Example: Follow up: Recursive solution is trivial, could you 阅读全文
posted @ 2019-09-25 10:19 schaffen 阅读(104) 评论(0) 推荐(0) 编辑