02 2017 档案
摘要:"题目" Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 分析 整数转化为罗马数字字符串 罗马数字: 采用七个罗马字母作数字、即Ⅰ(
阅读全文
摘要:"题目" Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 分析 罗马数字字符串转化成整数 罗马数字: 采用七个罗马字母作数字、即Ⅰ(
阅读全文
摘要:"题目" You are given a map in form of a two dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontal
阅读全文
摘要:"题目" Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime c
阅读全文
摘要:"题目" Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farth
阅读全文
摘要:"题目" Calculate the sum of two integers a and b, but you are not allowed to use the operator + and . Example: Given a = 1 and b = 2, return 3. 分析 不用+ 号
阅读全文
摘要:"题目" Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1
阅读全文
摘要:"题目" You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3
阅读全文
摘要:"题目" Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first t
阅读全文
摘要:"题目" Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 分析 字符串反转 解答 解法1:(我)(7m
阅读全文
摘要:"题目" Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the
阅读全文
摘要:"题目" Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: 1. The gi
阅读全文
摘要:"题目" The "Hamming distance" between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y,
阅读全文
摘要:跟着 "Webpack傻瓜式指南(一)" 这个教程在安装webpack和webpack dev server的时候遇到很多问题,查了很多终于一一找到解决办法。 主要参考了这三篇博文: "moudule.js:338 throw err; Error: Cannot find module 'webp
阅读全文