easy
文章平均质量分 54
chuandalishuo
这个作者很懒,什么都没留下…
展开
-
28. Implement strStr() [easy]
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Java public class Solution { public int strStr(String haystac原创 2016-06-09 13:18:06 · 227 阅读 · 0 评论 -
206. Reverse Linked List
Reverse a singly linked list. /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solu原创 2016-10-21 15:35:17 · 130 阅读 · 0 评论 -
217, 219,220. Contains Duplicate I, II, III
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element原创 2016-10-27 01:40:41 · 280 阅读 · 0 评论 -
283. Move Zeroes
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. For example, given nums = [0, 1, 0, 3, 12], after calling you原创 2016-10-18 07:48:28 · 137 阅读 · 0 评论 -
171. Excel Sheet Column Number
Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 public c原创 2016-10-05 09:19:11 · 178 阅读 · 0 评论 -
191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 000000原创 2016-10-20 02:37:21 · 156 阅读 · 0 评论 -
202. Happy Number
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 integer, replace the number by the sum of the squares原创 2016-10-20 07:23:00 · 185 阅读 · 0 评论 -
203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5 /** * Definition for si原创 2016-10-20 07:27:44 · 165 阅读 · 0 评论 -
205. Isomorphic Strings
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 occurrences of a character must be replaced with anot原创 2016-10-21 09:13:03 · 147 阅读 · 0 评论