辣鸡刘的Leetcode之旅8【Add Binary,Sqrt(x),Merge Sorted Array】

【信息科学与工程学】【数据科学】数据科学领域 第六篇 算法设计 07 堆、栈、表、矩阵、集合、队列、数组、字符串、树、图、动态规划、结构体、元组的算法01 当前段必须包含所有字符的最后出现位置。1. 字符串分割成最多片段2. 基因序列功能域划分3. 文本段落划分4. 音频声道分离5. 图像色彩分区6. 社交网络社群划分7. 蛋白质结构域8. 音乐乐章分段9. 代码模块划分10. 章节划分特征:一次扫描,贪心确定边界。 阅读详情
  1. Add Binary
    题目描述;
Given two binary strings, return their sum (also a binary string).
The input strings are both non-empty and contains only characters 1 or 0.
Example 1:
Input: a = "11", b = "1"
Output: "100"
Example 2:
Input: a = "1010", b = "1011"
Output: "10101"

简单描述:二进制相加
代码如下:

class Solution:
    def addBinary(self, a, b):
        """
        :type a: str
        :type b: str
        :rtype: str
        """
        print(bin(int(a,2)+int(b,2))[2:])
        return bin(int(a,2)+int(b,2))[2:]
    
s=Solution()
s.addBinary("1010","1011")

python的函数真他娘的多。
本题中用到的:

bin() 返回一个整数 int 或者长整数 long int 的二进制表示。
示例如下:
>>>bin(10)
'0b1010'
>>> bin(20)
'0b10100'

上面的例子也说明了代码中为什么用到了[2:],就是从第3位开始;
然后让我们重新认识以下int这个函数:

int(x, base=10)
x -- 字符串或数字。
base -- 进制数,默认十进制。
举例如下:
>>>int()               # 不传入参数时,得到结果0
0
>>> int(3)
3
>>> int(3.6)
3
>>> int('12',16)        # 如果是带参数base的话,12要以字符串的形式进行输入,12 为 16进制
18
>>> int('0xa',16)  
10  
>>> int('10',8)  
8

69. Sqrt(x)

题目描述:

Implement int sqrt(int x).

Compute and return the square root of x, where x is guaranteed to be a non-negative integer.

Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned.
Example 1:
Input: 4
Output: 2
Example 2:
Input: 8
Output: 2
Explanation: The square root of 8 is 2.82842..., and since 
             the decimal part is truncated, 2 is returned.

翻译:求所给数字的平方根;
我做的第一种方法:

class Solution:
    def mySqrt(self, x):
        """
        :type x: int
        :rtype: int
        """
		mid=x//2
        if x == 0 or x == 1:
            return x
        for i in range(mid+1):
            if i * i <= x and (i + 1) * (i + 1) > x:
                print(i)
                return i

这种方法在编译器上可以AC,但是到了LeetCode的平台就提示:

351 / 1017 test cases passed.
Status: Time Limit Exceeded

也就是说时间复杂度太大了,毕竟是一个一个遍历。
第二种方法【二分思想】:

class Solution:
    def mySqrt(self, x):
        """
        :type x: int
        :rtype: int
        """
        low,high=0,x
        while low <= high:
            mid = (low + high) / 2
            if mid ** 2 <= x:
                low = mid + 1
            else:
                high = mid - 1
        return low - 1


s=Solution()
s.mySqrt(4)

88. Merge Sorted Array

题目描述:
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.

Note:

The number of elements initialized in nums1 and nums2 are m and n respectively.
You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2.
就是把两个已经排好序的数组,在不借助其他内存的基础上合并到一起(也是排好序的)
Example:

Input:
nums1 = [1,2,3,0,0,0], m = 3
nums2 = [2,5,6],       n = 3
Output: [1,2,2,3,5,6]

我的解法:
起初我是这样写的:

class Solution:
    def merge(self, nums1, m, nums2, n):
        """
        :type nums1: List[int]
        :type m: int
        :type nums2: List[int]
        :type n: int
        :rtype: void Do not return anything, modify nums1 in-place instead.
        """
        for i in range(len(nums2)):
            nums1.append(nums2[i])
        nums1.sort()

s=Solution()
s.merge([1,2,3,0,0,0],3,[2,5,6],3)

可是输出有0没法处理;
最后这样写的:

for i in range(len(nums2)):
     nums1[i+m]=nums2[i]
nums1.sort()

还有一种写法,值得学习,利用了堆栈的思维;

while(len(nums1)>m):
     nums1.pop(m)
while(len(nums2)>n):
     nums2.pop(n)
for i in nums2:
     nums1.append(i)
nums1.sort()
产业园区如何高效对接企业技术需求与高校科研成果?.docx 科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。 立即下载

相关推荐

国央企创新负责人如何快速掌握本地科技资源分布与匹配情况?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

UPCOJ-5333 - 大佬 - 数学期望

题目: 题目描述 辣鸡 ljh NOI 之后就退役了,然后就滚去学文化课了。 他发现 katarina 大佬真是太强了,于是就学习了一下 katarina 大佬的做题方法。 比如这是一本有 n 道题的练习册, katarina 大佬每天都会做 k 道题。 第一天做第 1~k 题,第二天做第 2~k + 1 题……第 n − k + 1 天做第 n − k + 1~n 道题。

LucienShui 824

国央企创新负责人如何实现科技成果的精准识别与高效筛选?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

20171023考试总结

辣鸡题目描述:辣鸡ljh NOI之后就退役了,然后就滚去学文化课了。然而在上化学课的时候,数学和化学都不好的ljh却被一道简单题难住了,受到了大佬的嘲笑。题目描述是这样的:在一个二维平面上有一层水分子,请问形成了多少个氢键?这个二维平面可以看做一个类似棋盘的东西,每个格子可以容纳一个水分子,左下角的格子为(0,0),这个格子右边的格子为(1,0),上方格子为(0,1),以此类推。辣鸡ljh当然不会做

LSY_LELOUCH_YUKI的博客 693

M系列芯片MacBook上UTM虚拟机部署达梦DM8的避坑指南

本文详细介绍了在M系列芯片MacBook上使用UTM虚拟机部署达梦数据库DM8的完整流程与避坑指南。针对ARM架构环境,重点解决了虚拟机选择、麒麟系统安装、系统调优及DM8命令行安装中的常见问题,为开发者提供了稳定可靠的国产数据库本地测试方案。

weixin_28455801的博客 454

uniapp+萤石视频监控实战:解决ezuikit.js真机调试不显示的5个关键步骤

本文针对Uniapp集成萤石视频监控时ezuikit.js在真机调试中黑屏不显示的问题,提供了5个关键解决步骤。核心方案是采用Webview加载独立H5播放页,以规避跨平台环境差异,并详细阐述了资源放置、多端适配、通信处理及系统化排查方法,确保视频流稳定播放。

weixin_29001655的博客 287

辣鸡mac之mysql

血泪史别说了。。。。装的最累的一次。。。。一开始刚买电脑就装了,然后就忘记密码了,凉凉啊,或者说一开始装的时候就有一些问题后来搁置了,具体还忘记了,反正也是密码的问题。。。。。然后因为flask要用,完全忘记密码,然后一开始用homebrew重装,还以为会hin牛逼咧,结果还是报错,pid ended什么的,一直产生的问题,反正百度就是一团乱,啥都不对,而且homebrew装的破坏了mysql官网...

cse1904的博客 356

.NET MAUI跨平台串口通讯方案

MAUI跨平台串口通信架构设计采用分层模式,核心是共享业务逻辑层与平台特定实现。通过定义统一的ISerialPortService接口,实现了Windows、Android、iOS和macOS四大平台的串口通信功能。Windows平台使用System.IO.Ports类库,Android通过USB Host模式实现,iOS基于ExternalAccessory框架,macOS则采用IOKit。该设计支持串口连接管理、数据收发等核心功能,并通过事件机制实现异步通信。架构采用条件编译区分各平台实现,确保代码复用

冰茶的博客 1664

与dalao学校的联hu考ce(10.27)

前言: 开考一个半小时一直以为自己做错题了 要是noip都是这种难度,那我可以滚回去学文化课了T2【题目描述】 辣鸡ljh NOI之后就退役了,然后就滚去学文化课了。 他每天都被katarina大神虐,仗着自己学过一些姿势就给katarina大神出了一道题。 有一棵 n 个节点的以 1 号节点为根的树,每个节点上有一个小桶,节点u上的小桶可以容纳ki个小球, ljh每次可以给一个

Coco_T的博客 651

手把手教你用支付宝密钥工具生成RSA2密钥对(含Windows/Mac操作截图)

本文详细介绍了如何使用支付宝密钥工具生成RSA2密钥对,包括Windows和Mac平台的操作步骤与截图。从工具下载、安装到密钥生成、配置支付宝平台,再到开发环境集成实战,手把手教你完成支付宝支付接口对接。特别强调密钥安全管理和最佳实践,帮助开发者避免常见安全隐患。

mongodb5scout的博客 257

【 Git学习记录(三)】推荐四款主流的Git代码托管平台 —— GitHub、GitLab、Gitee、Coding

了解过Git之后,作为一个程序猿最基本的,你还需要了解目前主流的在线代码托管平台,并至少选择其中一款在平时开发中使用。这里特别介绍以下四款: 国外平台 GitHub —— 全球最流行的代码托管平台 GitLab —— 基于git的仓库管理程序 国内平台 Gitee —— 开源中国旗下的代码托管平台 Coding —— 支持社交元素的代码托管平台 一. GitHub 链接地址:https://github.com/ GitHub目前是全球最流行的代码托管平台(别称:全球最大的同性交友.

JZevin的博客 6092

辣鸡刘的Leetcode之旅2【最长公共前缀,有效的括号,合并链表,删除排序数组中的重复项】

Longest Common Prefix 2. 最长公共前缀 问题描述: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string ” “. 编写一个函数来查...

lwj的小站 372

Python爬虫实战:5分钟抓取东方财富股票数据并保存为CSV

在投资分析与量化研究的日常工作中,获取结构化、可用的金融数据往往是第一步。对于个人投资者和量化入门者而言,如何高效获取A股全市场行情,常常面临网页动态加载、反爬机制与数据整理繁琐等挑战。本文从数据采集的基础概念出发,介绍如何利用Python这一通用编程语言,通过requests库请求财经网站公开的HTTP接口,获取返回的JSON数据,再借助pandas进行字段映射、数据清洗与表格化处理。这种方式相比传统页面解析具有响应快、结构稳定、易于批量操作的显著优势,尤其适合构建个人股票数据池、验证选股策略或进行市场情

weixin_33146151的博客 251

leetcode刷题记录

1. 爬楼梯 import numpy as np class Solution: def climbStairs(self, n: int) -> int: res=np.zeros(n+1,np.int) res[0],res[1]=1,1 for i in range(2,n+1): res[i] = ...

zhongqiqianga的博客 1943

【Codex】Codex安装+DeepSeek API接入;无需登录,手把手带你使用codex

好多人使用codex时都卡在验证码登录那一步,今天就来介绍一种方法,不需要登录ChatGPT的账号,自然也就不需要手机验证码了;接入DeepSeek的api,一样可以丝滑使用codex;记录从零开始安装使用codex以及DeepSeek API接入的整个过程。不需要登录openAI;

AnChenliang_1002的博客 3539

高通Camx功能feature分析之二:remosaic流程

本文介绍了Remosaic技术及其在图像处理中的应用。Remosaic是将4cell1像素排布还原为普通Bayer结构的过程,分为硬件和软件两种实现方式。文章详细解析了Remosaic流程,包括配流情况、Feature选择、初始化过程,以及触发拍照的完整流程。重点分析了从普通预览切换到全尺寸拍照的关键步骤:激活全尺寸RDI会话、生成请求、等待就绪、唤醒离线线程和重启预览。通过代码层面的分析,揭示了Remosaic技术如何实现高分辨率图像还原,同时说明了该过程中可能出现的预览定屏现象及其原因。

1880

Prepare50

遍历一次,建一个value为dict,key为下标的dict,每次去里面判断下,要找的数是否存在,时间复杂度O(n),空间负责度O(n)。

liuhe2296044的博客 940

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

辣鸡刘的Leetcode之旅4 (Weekly Contest 100)【单调序列,】

Monotonic Array 题目描述: An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i &amp;amp;amp;lt;= j, A[i] &amp;amp;amp;lt;= A[j]. An array A is mono...

lwj的小站 312

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

视频编码----H.264到H.265的转码

背景及意义 最新的高效视频编码 (HEVC) 标准相比H. 264高级视频编码标准实现了显著的压缩效率改进(50%),由于其优越的压缩性能, 它在许多应用中迅速被采用。 与H.264 标准相比,HEVC编码的计算复杂度非常高,使得难以在广泛用到的多媒体转码中的通用处理器上实现实时的高质量编码。 由于目前H.264广泛而深入的应用,大量现有的内容已经使用 H.264标准编码, 这时候如果...

lwj的小站 1万+

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

高速视觉伺服系统(一)

最近在学习相关知识,做个简要总结: 背景介绍 国内外研究现状 算法介绍 研究问题及实施方案 总结展望 背景介绍 研究表明,人类获得的80%以上的感官信息来自于视觉器官。借鉴同样的原理,借助视觉伺服系统,机器人可以广泛地用于掌握变化的外部环境。从而做出相应的反应。这就是伺服系统的背景。最典型的一个例子就是图中实况转播中乒乓球的高速追踪。 如果摄像头需要捕捉某一运动物体,常需要...

lwj的小站 7923

高速视觉伺服系统(二)

接着上期:https://blog.youkuaiyun.com/power1_power2/article/details/80084544 算法对比 误差公式 D&lt;W/16 : status A+: 成功追踪 W/16 &lt;D&lt;3W/16 : status A-: 可以追踪 D&gt;W/16 : status B: 追踪失败 Invisible : status...

lwj的小站 2360

辣鸡刘的Leetcode之旅6【移除元素, 实现strStr() ,寻找插入的位置,最长无重复子串, 最长回文字符 】

27. Remove Element 题目描述: Given 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 ...

lwj的小站 359

辣鸡刘的Leetcode之旅3(SQL Part)【两表合并查询,第二高薪,挣钱比经理多, 重复值查询】

1. 两表合并查询(Combine Two Tables) 题目描述: Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName | varchar | | LastName | v...

lwj的小站 349

辣鸡刘的LeetCode之旅-1 [two Sum算法,反转整数算法,回文数,罗马数转整数]

从今天开始,辣鸡刘学习一下搞搞算法,确定了leetcode网站,从最简单的开始学习和思考。 入门算法, 1. Two Sum 描述: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that ea...

lwj的小站 325

辣鸡刘的Leetcode之旅7【Length of Last Word,Maximum Subarray,count-and-say,Plus One】

58. Length of Last Word 题目描述: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist...

lwj的小站 305
上一篇: 辣鸡刘的Leetcode之旅7【Length of Last Word,Maximum Subarray,count-and-say,Plus One】
下一篇: MATLAB解方程组中 solve 和 fsolve 的细节比较
powerlwj
博客等级 码龄12年 116粉丝 33原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值