摘要: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2017-08-31 07:19 白常福 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2017-08-30 08:18 白常福 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh" 思路:直接转StringBuffer后reserve即可; 阅读全文
posted @ 2017-08-30 07:37 白常福 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-08-30 07:23 白常福 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-08-27 10:00 白常福 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: Exa 阅读全文
posted @ 2017-08-24 10:50 白常福 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-08-24 07:47 白常福 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文
posted @ 2017-08-24 07:25 白常福 阅读(140) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-08-14 08:07 白常福 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-08-14 08:02 白常福 阅读(407) 评论(0) 推荐(0) 编辑