题目 Given an array of size n, find the majority element. The majority element is the element that appears more …
标签:LeetCode Go
[LeetCode By Go 10]412. Fizz Buzz
题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three i…
[LeetCode By Go 22]Add to List 371. Sum of Two Integers
题目 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Gi…
[LeetCode By Go 15]292. Nim Game
题目 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time …
[LeetCode By Go 87]345. Reverse Vowels of a String
题目 Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s =…
[LeetCode By Go 72]70. Climbing Stairs
题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 …
[LeetCode By Go 13]637. Average of Levels in Binary Tree
题目 Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.…
[LeetCode By Go 26]606. Construct String from Binary Tree
题目 You need to construct a string consists of parenthesis and integers from a binary tree with the preorder tr…
[LeetCode By Go 25]389. Find the Difference
题目 Given two strings s and t which consist of only lowercase letters. String t is generated by random shufflin…
[LeetCode By Go 99]374. Guess Number Higher or Lower
题目 We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which…
[LeetCode By Go 101]9. Palindrome Number
题目 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integ…
[LeetCode By Go 24]653. Two Sum IV - Input is a BST
题目 Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such tha…