自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 数组异或操作

XOR Operation in an ArrayGiven an integer n and an integer start.Define an aray nums where nums[i] = start + 2*i (0-indexed) and n == nums.length.Return the bitwise XOR of all elements of nums.Example 1:Input: n = 5, start = 0Output: 8Explanation:

2021-05-07 16:57:12 601

原创 平方数之和

Sum of Square NumbersGiven a non-negative integer c, decide whether there’s two integers a and b such that a^2 + b^2 = c.Example 1:Input: c = 5Output: trueExplanation: 1 * 1 + 2 * 2 = 5Example 2:Input: c = 3Output: falseExample 3:Input: c =

2021-04-28 15:37:44 430

原创 组合总数IV

Combination Sum IVGiven an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.The answer is guaranteed to fit in a 32-bit integer.Example 1:Input: nums = [1, 2, 3], target = 4

2021-04-24 11:32:59 121

原创 解码方法

Decode WaysA message containing letters from A-Z can be encoded into numbers using the following mapping:​ ‘A’ -> “1”​ ‘B’ -> “2”​ …​ ‘Z’ -> “26”To decode the encoded message, all the digits must be grouped then mapped back into letters usin

2021-04-21 19:59:13 3878 2

原创 实现strStr()

implement strStr()Implement strStr()Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Clarification:What should we return when needle is an empty string? This is a great question to ask during an in

2021-04-20 11:52:19 79

原创 移除元素

Remove ElementGiven an array nums and a value val,remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.The orde

2021-04-19 21:55:00 156

原创 删除有序数组中的重复项

Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.Do not allocate extra space for another array, you must do this by modifying the input array

2021-04-18 13:51:00 110

原创 二叉搜索树节点最小距离

Minimum Distance Between BST NodesGiven the root of a Binary Search Tree(BST), return the minimum difference between the values of any two different nodes in the tree.今天的题目是求二叉搜索树的节点之间的最小距离,即求树中任意两个节点差值的最小值。而我们知道,二叉搜索树的特点是,左子树一定小于根节点,右子树一定大于根节点,而且二叉搜索树

2021-04-13 21:01:55 214

原创 最大数

Largest NumberGiven a list of non-negative integers nums ,arrange them such that thry form the largest number.Note: The result may be very large, so you need to return a string instead of an integer.今天的题目依然是一道中等难度的题,题目要求一个非负整数数组能拼接出的最大数。即输入一个非负整数数组,返回这

2021-04-12 19:08:08 100

原创 搜索旋转排序数组II

Search in Rotated Sorted Array II​ There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).​ Before being passed to your function, nums is rotated at an unknown pivot index k(0<=k<nums.length) such that

2021-04-07 14:41:03 128

原创 删除有序数组中的重复项II

Remove Duplicates from Sorted Array II​ Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.​ Do not allocate extra space for another array; you must do this by modifying the inp

2021-04-06 19:52:22 227

原创 笨阶乘

Clumsy Factorial​ Normally, the factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 .​ We instead make a clumsy factorial: using the intege

2021-04-01 08:45:18 97

原创 子集II

Subsets II​ Given an integer array nums that may contain duplicates, return all possible subsets(the power set). The solution set must not contain duplicate subsets. Return the solution in an order.​​ 题目的输入是一个数组,其中可能含有重复的元素;要求的结果是这个数组的所有子集的集合,也就是幂集,且结果集

2021-03-31 16:01:51 58

原创 搜索二维矩阵

Search a 2D Matrix今天的每日一题是一道中等难度,题目描述如下:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each row if greater tha

2021-03-30 12:56:55 95

原创 删除有序链表中的重复节点II

Remove Duplicates from sorted list II​ #算法每日一题#今天的每日一题,它的题目描述是这样的:Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well.解法一​

2021-03-25 16:03:47 282

原创 log4net简单的配置以及在配置过程中遇到的问题

log4net简单的配置以及在配置过程中遇到的问题这一篇博客主要是为了记录我在初接触log4net,进行相关的配置时遇到的一个问题前面加了我自己做的学习log4net的学习笔记,写的比较粗略,不适用于做学习的参考,主要看最后一部分遇到的那一个问题希望能通过我的记录帮助到和我一样的学习者们实例配置样例(将日志写入回滚文件)在CS程序的App.config或者BS程序的Web.config里配置:<configSections> <section name="log4net" t

2020-10-23 20:09:33 229

原创 只交换相邻元素的条件下,排序数组需要的最小交换次数

只交换相邻元素的条件下,排序数组需要的最小交换次数今天刷到了这样一道算法题:在只交换相邻元素的条件下,求将数组排序好需要的最少的交换次数。看起来挺简单的一道题,首先我这个算法新手就想到了:既然只能交换相邻元素,那不就是冒泡排序吗?我只要在冒泡排序中加一个计数器就好了呀。于是我首先写出了如下方法: public static int Sort(int n, int[] value) { int sum = 0; for(int i = 0;i<n;i ++) { for(int

2020-09-20 18:04:10 2987 1

转载 钉钉接口学习笔记

接口说明格式请求方式:GET/POST(HTTPS)请求地址:https://oapi.dingtalk.com/user/get?access_token=ACCESS_TOKEN&userid=USERID请求包体:​ …SDK请求示例:​ …返回结果:​ …1)请求方式,标明接口调用的HTTP方法,区分HttpGet/HttpPost请求。所有的请求都为HTTPS协议。2)请求地址,接口的请求地址3)请求包体/参数说明,标明请求参数实例及说明,参数说明包括字段含义、取

2020-09-20 17:17:39 17695

原创 SQL学习笔记——基本语句

SQL基本语句use DATABASE;命令用于选择数据库SELECTSELECT语句用于从数据库中选取数据。结果被存储在一个结果表中,称为结果集。基本语法为:SELECT column_name,column_name FROM table_name;也可以省略column_name,写为:SELECT * FROM table_name;实例1:从Students表中选取“id”和“name”列SELECT id,name FROM Students;实例2:从St

2020-08-05 18:42:06 316

原创 Git基础(一)———Git的安装以及本地库的操作

Git基础(一)Git是什么?(为什么要学Git)Git的安装在linux上安装Git在Mac OS 上安装Git在Windows上安装Git创建版本库向版本库中添加文件Git的基本操作版本回退管理修改撤销修改删除文件Git是什么?(为什么要学Git)用最官方的话来说,Git是目前世界上最先进的分布式版本控制系统那么,究竟什么是版本控制系统呢?它有什么优越之处呢?我们一定或多或少有过这样的经历:对一个程序Program,我们想改动其中一段代码,但又怕改了之后功能不尽如人意,万一以后又想改回来怎么办

2020-08-03 20:04:52 222

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除