-- 判断某个数据库是否存在,存在就删除时的语句-- 创建数据库是必须先使用master数据库-- if 判断-- db_id 数据库ID名称-- is not null 判断是否为空-- drop 删除关键字-- database 数据库关键字-- 比如-- 判断学校数据库是否存在,存在就删除 u ...
分类:
数据库 时间:
2021-04-26 13:09:21
阅读次数:
0
给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个节点 p、q,最近公共祖先表示为一个节点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。” 示例 1: 输入:root = [3,5,1,6,2 ...
分类:
其他好文 时间:
2021-04-24 11:46:55
阅读次数:
0
学习自:CS-Note Leetcode 题解 - 双指针 1、有序数组的Two Sum 167. 两数之和 II - 输入有序数组 题目描述: 给定一个已按照 升序排列 的整数数组 numbers ,请你从数组中找出两个数满足相加之和等于目标数 target 。 函数应该以长度为 2 的整数数组的 ...
分类:
其他好文 时间:
2021-04-23 12:22:04
阅读次数:
0
import os, zipfile def deflate(paths, zip_path): z = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED, allowZip64=True, compresslevel=9) for path i ...
分类:
编程语言 时间:
2021-04-23 12:03:14
阅读次数:
0
i: /* * @lc app=leetcode.cn id=127 lang=cpp * * [127] 单词接龙 * * https://leetcode-cn.com/problems/word-ladder/description/ * * algorithms * Hard (45.95% ...
分类:
其他好文 时间:
2021-04-22 15:58:08
阅读次数:
0
1、 > a <- c(1,2,2,2,3,1,1,3) > a [1] 1 2 2 2 3 1 1 3 > unique(a) [1] 1 2 3 > duplicated(a) [1] FALSE FALSE TRUE TRUE FALSE TRUE TRUE TRUE > !duplicate ...
分类:
编程语言 时间:
2021-04-19 15:48:44
阅读次数:
0
滑动窗口 219. 存在重复元素 II 给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j],并且 i 和 j 的差的 绝对值 至多为 k。 // 滑动窗口做法 class Solution { public boolean co ...
分类:
其他好文 时间:
2021-04-19 15:40:01
阅读次数:
0
You are given a data structure of employee information, which includes the employee's unique id, their importance value and their direct subordinates' ...
分类:
其他好文 时间:
2021-04-13 12:31:50
阅读次数:
0
利用上一题求深度的做法 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = ...
分类:
其他好文 时间:
2021-04-13 12:05:30
阅读次数:
0
[LeetCode]丑数 II&C++中priority_queue和unordered_set的使用 考虑到现实因素,LeetCode每日一题不再每天都写题解了(甚至有可能🕊掉题目?……)但对于非常有意思和新奇的做法,还是会尽量记录下来 问题 给你一个整数 n ,请你找出并返回第 n 个 丑数 ...
分类:
编程语言 时间:
2021-04-12 12:47:16
阅读次数:
0