posted @ 2015-06-03 23:56
随笔分类 - LeetCode
摘要:eclipse没问题,leetcode 1不能通过,超出int最大值了,但是怎么转无符号?/*Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known a...
阅读全文
摘要:/*Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit...
阅读全文
posted @ 2015-06-03 22:13
摘要:主意利用asc码 /*Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA
阅读全文
posted @ 2015-06-03 21:45
摘要:/*Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integ...
阅读全文
posted @ 2015-06-03 21:11
摘要:超时版:/*Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur...
阅读全文
posted @ 2015-06-03 00:18
摘要:超时版:/*Contains Duplicate II Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array su...
阅读全文
posted @ 2015-06-02 11:09
摘要://Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the a...
阅读全文
posted @ 2015-06-02 11:07
浙公网安备 33010602011771号