题目 Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s =…
标签:LeetCode Go
[LeetCode By Go 2]617. Merge Two Binary Trees
题目 Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two …
[LeetCode By Go 60]543. Diameter of Binary Tree
题目 Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary t…
[LeetCode By Go 85]118. Pascal's Triangle
题目 Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Retur…
[LeetCode By Go 65]594. Longest Harmonious Subsequence
题目 We define a harmonious array is an array where the difference between its maximum value and its minimum val…
[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 29]492. Construct the Rectangle
马上写了30道题目了,使用golang写起题目来代码简洁明了,还可以非常方便的写测试用例,加上Goland可以进行调试,有如神助。 但无论如何,写了测试就会依赖测试判断对错,用了debug就会依赖debug来寻找出错的地…
[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 68]645. Set Mismatch
题目 The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the num…
[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 94]119. Pascal's Triangle II
题目 Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,…
[LeetCode By Go 38]Add to List 122. Best Time to Buy and Sell Stock II
题目 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm…