题目 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose …
标签:LeetCode Go
[LeetCode By Go 52]447. Number of Boomerangs
题目 Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points …
[LeetCode By Go 76]Add to List 191. Number of 1 Bits
本体不能用go语言写,因此用C语言 题目 Write a function that takes an unsigned integer and returns the number of ’1′ bits …
[LeetCode By Go 27]538. Convert BST to Greater Tree
二叉树的题目挺多的,写了个初始化二叉树的函数,以后用 func InitTree(index int, input []int) (t *TreeNode) { if index > len(input) { re…
[LeetCode By Go 63]121. Best Time to Buy and Sell Stock
题目 Say you have an array for which the ith element is the price of a given stock on day i. If you were only pe…
[LeetCode By Go 32]349. Intersection of Two Arrays
题目 Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums…
[LeetCode By Go 50]206. Reverse Linked List
题目 Reverse a singly linked list. 解题思路 头插法 代码 /** * Definition for singly-linked list. * type ListNode struct {…
[LeetCode By Go 4]476. Number Complement
题目描述 Given a positive integer, output its complement number. The complement strategy is to flip the bits of it…
[LeetCode By Go 73]437. Path Sum III
题目 You are given a binary tree in which each node contains an integer value. Find the number of paths that sum…
[LeetCode By Go 104]38. Count and Say
题目 The count-and-say sequence is the sequence of integers with the first five terms as following: 1 11 21 1211…
[LeetCode By Go 53]628. Maximum Product of Three Numbers
题目 Given an integer array, find three numbers whose product is maximum and output the maximum product. Example…
[LeetCode By Go 57]268. Missing Number
题目 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing f…