题目 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing f…
标签:LeetCode Go
[LeetCode By Go 105]112. Path Sum
题目 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the va…
[LeetCode By Go 46]100. Same Tree
题目 Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered…
[LeetCode By Go 50]206. Reverse Linked List
题目 Reverse a singly linked list. 解题思路 头插法 代码 /** * Definition for singly-linked list. * type ListNode struct {…
[LeetCode By Go 95]232. Implement Queue using Stacks
题目 Implement the following operations of a queue using stacks. push(x) — Push element x to the back of q…
[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 74]83. Remove Duplicates from Sorted List
本题目测试中给出了 初始化链表 和 判断两个链表是否相同 的方法 题目 Given a sorted linked list, delete all duplicates such that each element a…
[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 108]438. Find All Anagrams in a String
题目的通过率越来越低,题目越来越长,题意不好理解,边界问题,优化问题叠加,导致解题时间大大增加,对我的目标–快速复习一遍技术数据结构和算法阻碍很大啊!已经写了一百多道题了,是时候针对性的做一些题目了。目前打算…
[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 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 55]350. Intersection of Two Arrays II
题目 Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums…