摘要: http://oj.leetcode.com/problems/3sum-closest/Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution. For example, given array S = {-1 2 1 ... 阅读全文
posted @ 2013-10-28 16:07 移山测试工作室黑灯老师 阅读(941) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/3sum/Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)The solution set must not 阅读全文
posted @ 2013-10-28 15:28 移山测试工作室黑灯老师 阅读(499) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.思路:没什么技巧,第一行第一个字符拿出来和其它所有行的第一个字符比,然后第二个,第三个。如果碰到不相等或某行结束就中断。 1 class Solution { 2 public: 3 string longestCommonPrefix(vector &strs) { 4 if (0 == st... 阅读全文
posted @ 2013-10-28 15:12 移山测试工作室黑灯老师 阅读(334) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/roman-to-integer/Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路:根据个十百千位分别作为一个状态机处理就可以了。 1 class Solution { 2 public: 3 int romanToInt(string s) { 4 int val = 0, mul = 0; 5 char one, five... 阅读全文
posted @ 2013-10-28 14:12 移山测试工作室黑灯老师 阅读(453) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/integer-to-roman/Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路:先google一下罗马数字表示法。然后查表搞定。 1 static char* roman_table[4][9] = {{"I", "II", "III", "IV", "V", & 阅读全文
posted @ 2013-10-28 13:47 移山测试工作室黑灯老师 阅读(294) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/container-with-most-water/Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a 阅读全文
posted @ 2013-10-28 13:14 移山测试工作室黑灯老师 阅读(341) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not par 阅读全文
posted @ 2013-10-28 12:20 移山测试工作室黑灯老师 阅读(995) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer to string, note the restriction of using extra s 阅读全文
posted @ 2013-10-26 06:41 移山测试工作室黑灯老师 阅读(384) 评论(0) 推荐(0) 编辑
摘要: http://oj.leetcode.com/problems/string-to-integer-atoi/Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.Notes: It is intended for this problem to be 阅读全文
posted @ 2013-10-25 07:17 移山测试工作室黑灯老师 阅读(307) 评论(0) 推荐(0) 编辑
摘要: How the Google+ Team Tests Mobile Apps byEduardo Bravo Ortiz“移动第一”在当下已成为很多公司的口头禅。但是能够用一种合理的方法来测试移动应用却是非常有挑战的工作。今天Google+团队将和你一起分享iOS和Android平台上移动应用测试的成功经验和走过的弯路。平台无关部分深入理解你的平台。Andoird上的测试和iOS是不同的。无论是测试工具还是框架在这两个平台上都有巨大的差异。例如Andoird使用Java而iOS使用Objective-C,UI布局在不同平台上差别很大,而且UI自动化框架在不同平台上的工作方式也随着变化。稳定你的 阅读全文
posted @ 2013-10-23 03:51 移山测试工作室黑灯老师 阅读(1153) 评论(0) 推荐(0) 编辑
count website visits
Buy Computers