题目 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num…
分类:LeetCode
[LeetCode By Go 102]141. Linked List Cycle
这道题不能用go写,所以用C语言写的 题目 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it with…
[LeetCode By Go 724] Easy, Array, 724. Find Pivot Index
题目 Given an array of integers nums, write a method that returns the “pivot” index of this array. W…
[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 21]448. Find All Numbers Disappeared in an Array
题目 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others ap…
[LeetCode By Go 54]401. Binary Watch
题目 A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represe…
[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 81]235. Lowest Common Ancestor of a Binary Search Tree
该题目不能用go语言写,因此使用了C语言(C++忘的更多…)。Go语言写多了,判断语句也忘了加括号,语句末尾忘了加”;”,一条语句的statement也加了”{}̶…
[LeetCode By Go 51]409. Longest Palindrome
题目 Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes…
[LeetCode By Go 93]110. Balanced Binary Tree
题目 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is…
[LeetCode By Go 41]563. Binary Tree Tilt
题目 Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute …
[LeetCode By Go 12]496. Next Greater Element I
题目 You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. F…