AI工具人

标签：leetcode

Leetcode contests 95 题解

876. Middle of the Linked List 　　简单题，我的做法是先数下个数，然后知道中间节点是第几个了。 ~谢谢打赏~ 赏

Leetcode contests 93 题解

868. Binary Gap 　　简单题，就是求一个数字二进制形式中两个１的最大间隔位置，比如22的二进制0b10110，最大距离就是2，0b100001，最大距离是5。 ~谢谢打赏~ 赏

Leetcode 582. Kill Process

Leetcode 582. Kill Process 　　好久没刷题，今天来一道比较简单的题目，如果此题作为一道面试题，可以延伸出树的遍历，栈和队列，hashmap，treemap等，还是比较能考验基础的面试题。 ~谢谢打赏~ 赏

Leetcode 114. Flatten Binary Tree to Linked List

Leetcode 114. Flatten Binary Tree to Linked List 　　题目意思很简单，就是把一棵二叉数转换为链表，虽然题目中没说以什么样的形式转换，但看下样例就很容易看出来，是以先序遍历的次序转换成链表。这里...

Leetcode 365. Water and Jug Problem

Water and Jug Problem You are given two jugs with capacities x and y litres. There is an infinite amount of water supply...

Leetcode 230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. 求一个二叉搜索树的第k小值。 题目链接：htt...

Leetcode 313. Super Ugly Number

Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are i...

Leetcode 11. Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are...

Leetcode 3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. 原题链接：Longest Substring Without Re...