随笔分类 -  Easy

摘要:Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2018-10-19 18:00 一丝清风一抹红尘 阅读(145) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2018-10-19 17:32 一丝清风一抹红尘 阅读(111) 评论(0) 推荐(0)
摘要:ou are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality ch 阅读全文
posted @ 2018-10-19 16:38 一丝清风一抹红尘 阅读(137) 评论(0) 推荐(0)
摘要:Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: 阅读全文
posted @ 2018-10-19 16:36 一丝清风一抹红尘 阅读(111) 评论(0) 推荐(0)
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2018-10-19 12:44 一丝清风一抹红尘 阅读(157) 评论(0) 推荐(0)
摘要:Remove all elements from a linked list of integers that have value val. Example: 阅读全文
posted @ 2018-10-18 16:16 一丝清风一抹红尘 阅读(89) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 阅读全文
posted @ 2018-10-18 14:14 一丝清风一抹红尘 阅读(93) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Op 阅读全文
posted @ 2018-10-18 14:05 一丝清风一抹红尘 阅读(144) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2018-10-18 13:54 一丝清风一抹红尘 阅读(124) 评论(0) 推荐(0)
摘要:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文
posted @ 2018-10-18 12:58 一丝清风一抹红尘 阅读(152) 评论(0) 推荐(0)
摘要:The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read off as "two 1 阅读全文
posted @ 2018-10-18 12:21 一丝清风一抹红尘 阅读(130) 评论(0) 推荐(0)
摘要:In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least 阅读全文
posted @ 2018-10-18 12:03 一丝清风一抹红尘 阅读(267) 评论(0) 推荐(0)
摘要:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
posted @ 2018-10-18 11:09 一丝清风一抹红尘 阅读(150) 评论(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 have ex 阅读全文
posted @ 2018-10-17 19:12 一丝清风一抹红尘 阅读(109) 评论(0) 推荐(0)
摘要:You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups b 阅读全文
posted @ 2018-10-17 18:59 一丝清风一抹红尘 阅读(147) 评论(0) 推荐(0)
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2018-10-17 17:59 一丝清风一抹红尘 阅读(125) 评论(0) 推荐(0)
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the dep 阅读全文
posted @ 2018-10-17 14:48 一丝清风一抹红尘 阅读(127) 评论(0) 推荐(0)
摘要:mplement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文
posted @ 2018-10-17 14:38 一丝清风一抹红尘 阅读(120) 评论(0) 推荐(0)
摘要: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 or 阅读全文
posted @ 2018-10-17 14:22 一丝清风一抹红尘 阅读(120) 评论(0) 推荐(0)
摘要:Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d 阅读全文
posted @ 2018-10-17 14:06 一丝清风一抹红尘 阅读(137) 评论(0) 推荐(0)