摘要: Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 代码的主要思路就是一位一位相加。具体代码实现过程如下。 但是关注了一下,评论区大神的 阅读全文
posted @ 2019-01-03 11:27 sup_liu9504 阅读(105) 评论(0) 推荐(0)
摘要: 在一个二维数组中(每个一维数组的长度相同), 每一行都按照从左到右递增的顺序排序, 每一列都按照从上到下递增的顺序排序。 请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 思路:选取右上角元素, 元素大于Key--》剔除整列, 元素小于key--》剔除整行*/ 注意点就是循环的条件 对于row行 从上0开始递增,停止的条件是小于行的长度 对于c... 阅读全文
posted @ 2019-01-02 11:06 sup_liu9504 阅读(104) 评论(0) 推荐(0)
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-12-04 16:22 sup_liu9504 阅读(231) 评论(0) 推荐(0)
摘要: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which cou 阅读全文
posted @ 2017-11-18 22:00 sup_liu9504 阅读(124) 评论(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 @ 2017-11-18 11:29 sup_liu9504 阅读(118) 评论(0) 推荐(0)
摘要: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2017-11-12 20:45 sup_liu9504 阅读(135) 评论(0) 推荐(0)
摘要: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 每次相加的时候每位会出现0,1 ,2 ,3的情况,其对应的二进制是0,1,0,1.所 阅读全文
posted @ 2017-11-11 15:46 sup_liu9504 阅读(132) 评论(0) 推荐(0)
摘要: We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2017-11-10 21:12 sup_liu9504 阅读(99) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示