2016年4月25日
摘要: 1.任意字符串,删除重复字符 2.字符串中只包含小写字母‘a'-'z' 注:该方法仅适用于字符串全部为小写字母或全部为大写字母的情况,int为32位,可以表示26个字母 阅读全文
posted @ 2016-04-25 22:37 小菜鸡y 阅读(663) 评论(0) 推荐(0) 编辑
摘要: question: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 阅读全文
posted @ 2016-04-25 22:12 小菜鸡y 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 算法: 1)初始化,设当前数组为arr[],长度为n,当前元素cur=arr[0],元素出现次数为count; 2)遍历数组,若count==0,设cur=arr[i],count=1;否则,转向3) 3)若arr[i]==cur,则count++,否则,转向4) 4)count--,当i==n-1 阅读全文
posted @ 2016-04-25 17:48 小菜鸡y 阅读(493) 评论(0) 推荐(0) 编辑
摘要: Question: 一个int数组,;一面数据无任何限制,要求求出所有这样的数a[i],其左边数数都小于等于它,右边的数都大于等于它 阅读全文
posted @ 2016-04-25 17:16 小菜鸡y 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: Question: 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? Su 阅读全文
posted @ 2016-04-25 16:12 小菜鸡y 阅读(199) 评论(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 @ 2016-04-25 15:43 小菜鸡y 阅读(185) 评论(0) 推荐(0) 编辑