摘要: 题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 s 阅读全文
posted @ 2018-10-17 09:36 shinjia 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a le 阅读全文
posted @ 2018-10-17 09:32 shinjia 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non zero elements. Example: Inpu 阅读全文
posted @ 2018-10-17 09:29 shinjia 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 题目 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the qualit 阅读全文
posted @ 2018-10-17 09:24 shinjia 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Out 阅读全文
posted @ 2018-10-15 10:59 shinjia 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a binary tree, return all root to leaf paths. Note: A leaf is a node with no children. Example: Input: 1 / \ 2 3 \ 5 Output: ["1 2 5", "1 3"] 阅读全文
posted @ 2018-10-15 10:14 shinjia 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Exam 阅读全文
posted @ 2018-10-15 09:00 shinjia 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a non negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The 阅读全文
posted @ 2018-10-15 08:40 shinjia 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 题目 Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Exam 阅读全文
posted @ 2018-10-14 11:36 shinjia 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 题目 Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list head = [4,5,1,9], wh 阅读全文
posted @ 2018-10-14 11:20 shinjia 阅读(94) 评论(0) 推荐(0) 编辑