随笔分类 -  水题

摘要:Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: A partially filled sudoku which 阅读全文
posted @ 2019-02-03 14:08 TobicYAL 阅读(186) 评论(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 @ 2019-02-03 11:47 TobicYAL 阅读(134) 评论(0) 推荐(0)
摘要:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2019-02-02 22:54 TobicYAL 阅读(134) 评论(0) 推荐(0)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y 阅读全文
posted @ 2019-02-02 22:14 TobicYAL 阅读(123) 评论(0) 推荐(0)
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2019-02-01 14:07 TobicYAL 阅读(135) 评论(0) 推荐(0)
摘要:Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Example 2: Cla 阅读全文
posted @ 2019-01-30 11:32 TobicYAL 阅读(128) 评论(0) 推荐(0)
摘要:Given an array nums and a value val, remove all instances of that value in-placeand return the new length. Do not allocate extra space for another arr 阅读全文
posted @ 2019-01-30 10:48 TobicYAL 阅读(144) 评论(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 @ 2019-01-30 10:35 TobicYAL 阅读(155) 评论(0) 推荐(0)
摘要:Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文
posted @ 2019-01-30 09:31 TobicYAL 阅读(153) 评论(0) 推荐(0)
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
posted @ 2019-01-29 14:03 TobicYAL 阅读(122) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No 阅读全文
posted @ 2019-01-29 12:08 TobicYAL 阅读(157) 评论(0) 推荐(0)
摘要:Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. Follow up: Could you 阅读全文
posted @ 2019-01-29 12:00 TobicYAL 阅读(154) 评论(0) 推荐(0)
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
posted @ 2019-01-26 11:53 TobicYAL 阅读(137) 评论(0) 推荐(0)
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2019-01-26 09:44 TobicYAL 阅读(186) 评论(0) 推荐(0)
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2019-01-26 09:32 TobicYAL 阅读(151) 评论(0) 推荐(0)
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文
posted @ 2019-01-26 09:21 TobicYAL 阅读(138) 评论(0) 推荐(0)
摘要:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3: 阅读全文
posted @ 2019-01-25 10:51 TobicYAL 阅读(148) 评论(0) 推荐(0)
摘要:Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white 阅读全文
posted @ 2019-01-25 10:45 TobicYAL 阅读(166) 评论(0) 推荐(0)
摘要:Problem A. Standing Ovation Problem It's opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in t 阅读全文
posted @ 2019-01-23 11:36 TobicYAL 阅读(245) 评论(0) 推荐(0)
摘要:Easy Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment whic 阅读全文
posted @ 2019-01-20 15:31 TobicYAL 阅读(132) 评论(0) 推荐(0)