摘要:
Problem:Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->... 阅读全文
摘要:
problem:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. ... 阅读全文
摘要:
problem:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2... 阅读全文
摘要:
Problem:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:顺时针方... 阅读全文
摘要:
problem:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.思路解析:使用hashmap来存储已排好序的字符串。注意i... 阅读全文
摘要:
Problems:Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear ... 阅读全文
摘要:
Problems:Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtim... 阅读全文
摘要:
Problem:Write a function to find the longest common prefix string amongst an array of strings.Solution:题意要求求取字符串数组的最长公共前缀子串。从位置0开始,对每一个位置比较所有的字符串,直到遇到... 阅读全文