这个题目思路比较好想,但是边界问题好难搞,测了好多次才成功。 题目 Given two strings s and t, determine if they are isomorphic. Two strings are…
分类:LeetCode
[LeetCode By Go 8]566. Reshape the Matrix
用golang写这道题的做法完全不同,用到了gorutine, channel,写着挺有意思的 题目 In MATLAB, there is a very useful function called ‘re…
[LeetCode By Go 1]461. Hamming Distance
题目描述 https://leetcode.com/problems/hamming-distance/description/ The Hamming distance between two integers is …
[LeetCode By Go 100]26. Remove Duplicates from Sorted Array
题目 Given a sorted array, remove the duplicates in place such that each element appear only once and return the…
[LeetCode By Go 43]387. First Unique Character in a String
题目 Given a string, find the first non-repeating character in it and return it’s index. If it doesn’…
[LeetCode By Go 80]21. Merge Two Sorted Lists
题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together…
[LeetCode By Go 37]167. Two Sum II - Input array is sorted
题目 Given an array of integers that is already sorted in ascending order, find two numbers such that they add u…
[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 78]263. Ugly Number
题目 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose …
[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…