摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-12-08 19:20 code_yang 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, givenn... 阅读全文
posted @ 2015-12-04 10:31 code_yang 阅读(238) 评论(0) 推荐(0) 编辑
摘要: You are playing the followingBulls and Cowsgame with your friend: You write down a number and ask your friend to guess what the number is. Each time y... 阅读全文
posted @ 2015-12-04 09:46 code_yang 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given apatternand a stringstr, find ifstrfollows the same pattern.Herefollowmeans a full match, such that there is a bijection between a letter inpatt... 阅读全文
posted @ 2015-12-04 09:44 code_yang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 阅读全文
posted @ 2015-12-03 22:00 code_yang 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 今天刚刚开通了博客,以后会把每天刷的leetcode代码写在上面。加油,为了一年后的校园招聘! 阅读全文
posted @ 2015-12-03 20:37 code_yang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2015-12-03 20:28 code_yang 阅读(100) 评论(0) 推荐(0) 编辑