题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For ex…
分类:LeetCode
[LeetCode By Go 47]242. Valid Anagram
题目 Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = “a…
[LeetCode By Go 30]598. Range Addition II
题目 Given an m * n matrix M initialized with all 0’s and several update operations. Operations are repres…
[LeetCode By Go 90]643. Maximum Average Subarray I
题目 Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximu…
[LeetCode By Go 11]463. Island Perimeter
题目 You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents wate…
[LeetCode By Go 70]326. Power of Three
题目 Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it witho…
[LeetCode By Go 20]226. Invert Binary Tree
HomeBrew作者去Google面试做错的一道题,影响很大,大家一定要研究下这道题。 事件回放 2015 年 6 月 10 日,Homebrew 的作者 @Max Howell 在 twitter 上发表了如下一内容:…
[LeetCode By Go 64]405. Convert a Number to Hexadecimal
题目 Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement m…
[LeetCode By Go 96]434. Number of Segments in a String
题目 Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-spa…
[LeetCode By Go 98]172. Factorial Trailing Zeroes
题目 Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmi…
[LeetCode By Go 59]541. Reverse String II
题目 Given a string and an integer k, you need to reverse the first k characters for every 2k characters countin…
[LeetCode By Go 82]198. House Robber
题目 You are a professional robber planning to rob houses along a street. Each house has a certain amount of mon…