2021_02_02 LeetCode刷题

基因组研究之单倍型T2T基因组(一) 单倍型T2T基因组(Haplotype-resolved T2T genome)是一种高精度、高连续性、高完整性的基因组组装技术,它能够提供从端粒到端粒的完整基因组序列,包括所有的基因和非编码序列。完整覆盖:T2T基因组覆盖从端粒到端粒的染色体序列,包含所有的基因和非编码序列,包括以往难以解析的端粒和着丝粒区域。单倍型解析:单倍型T2T基因组能够区分来自父母本的遗传信息,进行亚基因组不对称演化研究,挖掘单倍型等位基因间的表达差异,这对于重测序、性状定位、进化、基因功能、基因编辑等研究至关重要。 阅读详情

1437. 是否所有 1 都至少相隔 k 个元素

简单模拟题。遍历数组判定即可。

class Solution {
public:
    bool kLengthApart(vector<int>& nums, int k) {
        int n = nums.size();
        int prev = -1;
        for (int i = 0; i < n; ++i) {
            if (nums[i] == 1) {
                if (prev != -1 && i - prev - 1 < k)
                    return false;
                prev = i;
            }
        }
        return true;
    }
};

1287. 有序数组中出现次数超过25%的元素

简单模拟题。有序数组,遍历过程中统计当前重复数字的个数是否超过了整个数组的25%即可。

class Solution {
public:
    int findSpecialInteger(vector<int>& arr) {
        int n = arr.size();
        int cur = arr[0], cnt = 0;
        for (int i = 0; i < n; ++i) {
            if (arr[i] == cur) {
                ++cnt;
                if (cnt * 4 > n)
                    return cur;
            }
            else {
                cur = arr[i];
                cnt = 1;
            }
        }
        return -1;
    }
};

1507. 转变日期格式

简单模拟题。使用哈希表映射转换即可。

class Solution {
public:
    string reformatDate(string date) {
        unordered_map<string, string> s2month = {
            {"Jan", "01"},
            {"Feb", "02"},
            {"Mar", "03"},
            {"Apr", "04"},
            {"May", "05"},
            {"Jun", "06"},
            {"Jul", "07"},
            {"Aug", "08"},
            {"Sep", "09"},
            {"Oct", "10"},
            {"Nov", "11"},
            {"Dec", "12"}
        };

        stringstream ss(date);
        string year, month, day;
        ss >> day >> month >> year;
        month = s2month[month];
        day.pop_back();
        day.pop_back();
        if (day.size() == 1)
            day = "0" + day;
        return year + "-" + month + "-" + day;
    }
};

1446. 连续字符

简单模拟题。统计最长的重复子串即可。

class Solution {
public:
    int maxPower(string s) {
        int len1 = s.length(), ans = 0, sum = 0;
        for(int i = 0; i < len1; i++) {
            sum = 1;
            while((i+1) < len1 && s[i+1] == s[i])
                sum += 1,i += 1;
            ans = max(ans, sum);
        }
        return ans;
    }
};

1556. 千位分隔数

简单模拟题。直接按照题目意思实现即可。

class Solution {
public:
    string thousandSeparator(int n) {
        string ans = "";
        if(n <= 999)
            ans = to_string(n);
        else {
            int sum = 0;
            stack<string> p;
            while(n) {
                p.push(to_string(n%10));
                n /= 10;
                sum += 1;
                if(sum == 3 && n != 0) {
                    sum = 0;
                    p.push(".");
                }
            }
            while(!p.empty()) {
                ans = ans + p.top();
                p.pop();
            }
        }
        return ans;
    }
};

1408. 数组中的字符串匹配

简单模拟题。每个字符串查找是否为另一个字符串的子串即可。

class Solution {
public:
    vector<string> stringMatching(vector<string>& words) {
        vector<string> ans;
        int len1 = words.size();
        for(int i = 0; i < len1; i++) {
            for(int j = 0;j < len1; j++) {
                if(i == j)
                    continue;
                if(words[j].find(words[i])!= string::npos) {
                    ans.push_back(words[i]);
                    break;
                }
            }
        }
        return ans;
    }
};

1184. 公交站间的距离

简单模拟题。先统计所有距离的和,然后顺序统计起点和终点的距离,另一个距离就是距离总和减去顺序求出的,最后比较返回较小值即可。

class Solution {
public:
    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {
        int len1 = distance.size(), sum = 0, sum1 = 0;
        for(int i = 0; i < len1; i++)
            sum += distance[i];
        int temp1 = min(start, destination), temp2 = max(start, destination);
        for(int i = temp1; i < temp2; i++) 
            sum1 += distance[i];
        return min(sum1, sum - sum1);
    }
};

1260. 二维网格迁移

简单模拟题。按照题目意思模拟,将所有元素先放置到一个一维数组中,之后根据移动的次数找到第一个放入矩阵中的元素,之后依次按顺序放入即可。

class Solution {
public:
    vector<vector<int>> shiftGrid(vector<vector<int>>& grid, int k) {
        vector<vector<int>> ans;
        int m = grid.size(), n = grid[0].size();
        k = k % (m * n);
        vector<int> temp;
        for(int i = 0; i < m; i++)
            for(int j = 0; j < n; j++)
                temp.push_back(grid[i][j]);
        int sum = 0;
        vector<int> z;
        for(int i = m * n - k; i < m * n; i++) {
            z.push_back(temp[i]);
            sum += 1;
            if(sum == n) {
                sum = 0;
                ans.push_back(z);
                z.clear();
            }
        }
        for(int i = 0; i < m * n - k; i++) {
            z.push_back(temp[i]);
            sum += 1;
            if(sum == n) {
                sum = 0;
                ans.push_back(z);
                z.clear();
            }
        }
        return ans;
    }
};

1071. 字符串的最大公因子

简单模拟题。最大公因子子串其实要从字符串长度的因数入手,先找到二者长度的所有公因数,然后截取公因数长度的子串作为最大公因串进行判定,最后得到最终的结果。

class Solution {
public:
    string gcdOfStrings(string str1, string str2) {
        vector<int> ans;
        int len1 = str1.length(), len2 = str2.length();
        for(int i = min(len1, len2); i >= 1; i--) {
            if(len1 % i == 0 && len2 % i == 0)
                ans.push_back(i);
        }
        int len3 = ans.size();
        string ans1 = "";
        for(int i = 0; i < len3; i++) {
            string sum = str1.substr(0, ans[i]);
            int z1 = len1 / ans[i], z2 = len2 / ans[i];
            string sum1 = "", sum2 = "";
            while(z1--)
                sum1 = sum1 + sum;
            while(z2--)
                sum2 = sum2 + sum;
            if(sum1 == str1 && sum2 == str2) {
                ans1 = sum;
                break;
            }
        }
        return ans1;
    }
};

937. 重新排列日志文件

简单模拟题。自定义排序规则,重新对于所有的字符串排序即可。 

class Solution {
public:
    static bool cmp(const string &a, const string &b){
        int i = 0, j = 0;
        while(a[i] != ' ') i ++;
        while(b[j] != ' ') j ++;
        string a_content = a.substr(i), b_content = b.substr(j);
        if (a_content != b_content) return a_content < b_content;
        else return a < b;
    }
    vector<string> reorderLogFiles(vector<string>& logs) {
        vector<string> res, alp;
        for(int i = 0, j = 0; i < logs.size(); i ++){
            j = logs[i].find(' ');
            if(logs[i][j + 1] >= '0' && logs[i][j + 1] <= '9') res.push_back(logs[i]);
            else alp.push_back(logs[i]);
        }
        sort(alp.begin(),alp.end(),cmp);
        res.insert(res.begin(),alp.begin(),alp.end());
        return res;
    }
};

 

STM32 cubeMX配置串口重定向 这篇文章主要讲解什么是串口重定向,为什么要串口串口重定向。使用printf函数和上位机通信是非常的方便的。希望大家都能够掌握。 阅读详情

相关推荐

小红书UID泄露风险揭秘:如何防止你的手机号被社工库关联(附防护指南)

本文揭示了小红书UID泄露的严重风险,详细解析了UID与手机号关联后被社工库利用的完整链条。通过分析黑产的数据整合技术,提供从基础到进阶的防护策略,包括密码管理、账号隔离和应急响应措施,帮助用户有效防范个人信息泄露风险。

ol789012345的博客 1504

Leetcode刷题 2021.02.11

Leetcode刷题 2021.02.11Leetcode306 累加数LeetcodeLCP12 小张刷题计划Leetcode673 最长递增子序列的个数 Leetcode306 累加数 累加数是一个字符串,组成它的数字可以形成累加序列。 一个有效的累加序列必须至少包含 3 个数。除了最开始的两个数以外,字符串中的其他数都等于它之前两个数相加的和。 给定一个只包含数字 ‘0’-‘9’ 的字符串,编写一个算法来判断给定输入是否是累加数。 说明: 累加序列里的数不会以 0 开头,所以不会出现 1, 2,

weixin_43447128的博客 319

CIC-IDS-2018数据集高效预处理实战:从数据清洗到特征整合

本文详细介绍了CIC-IDS-2018数据集的高效预处理方法,从数据清洗到特征整合的全流程实战。通过内存优化、异常值处理和特征工程等技巧,帮助网络安全研究人员快速处理大规模网络流量数据,提升机器学习模型的训练效率和准确率。特别针对特征数据的预处理提供了实用代码示例和优化建议。

weixin_29274969的博客 502

Leetcode刷题 2021.02.22

Leetcode刷题 2021.02.22Leetcode766 托普利茨矩阵Leetcode1765 地图中的最高点Leetcode1769 移动所有球到每个盒子所需的最小操作数 Leetcode766 托普利茨矩阵 给你一个 m x n 的矩阵 matrix 。如果这个矩阵是托普利茨矩阵,返回 true ;否则,返回 false 。 如果矩阵上每一条由左上到右下的对角线上的元素都相同,那么这个矩阵是 托普利茨矩阵 。 回上海了,发现假期都没做什么事。马上就要开学了,接下来就是春招和论文盲审了,要加油

weixin_43447128的博客 468

Ubuntu22.04系统安装及配置

下载Ubuntu22.04系统镜像(下载地址:链接:https://caiyun.139.com/m/i?提取码:fLRJ),结合rufus和系统镜像制作USB启动盘,在物理机服务器上通过USB启动盘进行安装;或通过Esxi虚拟化平台创建虚拟机,然后在虚拟机中使用系统镜像进行安装。

cheagoun的博客 8万+

ORB-SLAM2算法部署验证、原理代码和各种改进方法汇总

本文主要汇总个人学习使用ORB-SLAM2算法中参考的相关博客和代码汇总,以及在ORB-SLAM2算法基础上各个改进方法的汇总。

重点记录机器人和自动驾驶相关领域的技术,尤其是计算机视觉,视觉SLAM等,不仅有前言文献或必备算法的学习,也会有实际应用的点滴经验 742

Leetcode刷题 2021.02.27

Leetcode刷题 2021.02.27Leetcode1600 皇位继承顺序Leetcode395 至少有 K 个重复字符的最长子串Leetcode354 俄罗斯套娃信封问题 Leetcode1600 皇位继承顺序 一个王国里住着国王、他的孩子们、他的孙子们等等。每一个时间点,这个家庭里有人出生也有人死亡。 这个王国有一个明确规定的皇位继承顺序,第一继承人总是国王自己。我们定义递归函数 Successor(x, curOrder) ,给定一个人 x 和当前的继承顺序,该函数返回 x 的下一继承人。 马上

weixin_43447128的博客 282

硬核干货|C#+EtherCAT协议:高精度多轴伺服运动控制通信实战

本文摘要: 文章聚焦工业自动化领域多轴伺服运动控制的高精度与实时性需求,基于C#与EtherCAT协议实现完整解决方案。EtherCAT凭借微秒级同步、分布式架构等优势成为首选,而C#通过优化GC策略和实时线程可满足工业控制要求。文章从工程落地角度,详细拆解EtherCAT的PDO/SDO通信机制与多轴同步控制逻辑,提供完整的C#代码实现(主站初始化、伺服配置、运动控制等),所有代码均通过汇川/松下伺服实测验证。核心亮点包括:纯C#原生开发、工业现场高频问题解决方案、硬件适配指南,帮助开发者快速掌握高精度多

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 576

Leetcode刷题 2021.02.02

Leetcode刷题 2021.02.02Leetcode424 替换后的最长重复字符Leetcode1306 跳跃游戏 IIILeetcode1343 大小为 K 且平均值大于等于阈值的子数组数目 Leetcode424 替换后的最长重复字符 给你一个仅由大写英文字母组成的字符串,你可以将任意位置上的字符替换成另外的字符,总共可最多替换 k 次。在执行上述操作后,找到包含重复字母的最长子串的长度。 注意:字符串长度 和 k 不会超过 10^4。 正常的滑动窗口题,其实对滑动窗口一直掌握的不是很好。经常会

weixin_43447128的博客 212

【系统架构设计师】二十六、论文写作要点

论文写作概述:时间所需120分钟;题目可四选一,必有一题考察软件架构,总有一款适合你;考察形式是机试(开心,再也不用担心字丑了),约2500字。

帅次的博客 4598

Muse Spark:功能、性能测试及使用方法

对于一个仅用九个月时间从零开始重建的团队来说,这样的健康状况和多模态测试结果无疑是迈出了坚实的第一步,并且经受住了独立测试的考验。Muse Spark 为每个产品确定了最重要的主题(A 产品的发布策略、B 产品的定价策略、C 产品的规模化策略),并提出了切实可行的具体行动方案。抽象视觉推理也遵循同样的模式:Muse Spark 的 ARC-AGI-2 得分为 42.5,而 GPT-5.4 和 Gemini 的得分都在 70 分左右。他的离职是由于组织结构的变化限制了他的角色,以及团队转向闭源开发。

xiaoshun007的专栏 123

Leetcode刷题 2021.02.26

Leetcode刷题 2021.02.26Leetcode1178 猜字谜Leetcode869 重新排序得到 2 的幂Leetcode1676 二叉树的最近公共祖先 IV Leetcode1178 猜字谜 外国友人仿照中国字谜设计了一个英文版猜字谜小游戏,请你来猜猜看吧。 字谜的迷面 puzzle 按字符串形式给出,如果一个单词 word 符合下面两个条件,那么它就可以算作谜底: 单词 word 中包含谜面 puzzle 的第一个字母。 单词 word 中的每一个字母都可以在谜面 puzzle 中找到。

weixin_43447128的博客 286

PyCharm配置SSH和SFTP远程连接服务器

关于这篇博文,主要因为公司企业都是通过本地测试,同步到服务器进行跑动,舍友看着同事丝滑的操作,让我做个教程。本着钻研的精神,写下了这篇博客记录 关于pycharm这个软件,只有专业版才有远程连接的这个配置,社区版没有(同事一再强调要专业版,学生认证还可申请免费) 关于SSH和SFTP都是一种协议 具体知识点补充可看我这篇文章: 【计算机网络】常见面试题集锦(全) SSH:提供安全通道进行远程登录 SFTP协议可以远程文件传输获取等,数据的安全传输主要由SSH连接提供

码农研究僧的博客 5533

Leetcode刷题 2021.02.05

Leetcode刷题 2021.02.05Leetcode1267 统计参与通信的服务器Leetcode1415 长度为 n 的开心字符串中字典序第 k 小的字符串Leetcode1186 删除一次得到子数组最大和 Leetcode1267 统计参与通信的服务器 这里有一幅服务器分布图,服务器的位置标识在 m * n 的整数矩阵网格 grid 中,1 表示单元格上有服务器,0 表示没有。 如果两台服务器位于同一行或者同一列,我们就认为它们之间可以进行通信。 请你统计并返回能够与至少一台其他服务器进行通信

weixin_43447128的博客 333

深度学习工具包 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")

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Leetcode刷题 2021.02.07

Leetcode刷题 2021.02.07Leetcode5659 删除字符串两端相同字符后的最短长度Leetcode5658 任意子数组和的绝对值的最大值Leetcode5674 构造字典序最大的合并字符串 Leetcode5659 删除字符串两端相同字符后的最短长度 给你一个只包含字符 ‘a’,‘b’ 和 ‘c’ 的字符串 s ,你可以执行下面这个操作(5 个步骤)任意次: 选择字符串 s 一个 非空 的前缀,这个前缀的所有字符都相同。 选择字符串 s 一个 非空 的后缀,这个后缀的所有字符都相同。

weixin_43447128的博客 334

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Leetcode刷题 2021.02.25

Leetcode刷题 2021.02.25Leetcode537 翻转图像Leetcode554 砖墙Leetcode1432 改变一个整数能得到的最大差值 Leetcode537 翻转图像 给定两个表示复数的字符串。 返回表示它们乘积的字符串。注意,根据定义 i2 = -1 。 比较简单的题吧,就按照乘法公式来就行了。 class Solution { public String complexNumberMultiply(String a, String b) { String

weixin_43447128的博客 169

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Leetcode刷题 2021.02.24

Leetcode刷题 2021.02.24Leetcode832 翻转图像Leetcode1706 球会落何处Leetcode1054 距离相等的条形码 Leetcode832 翻转图像 给定一个二进制矩阵 A,我们想先水平翻转图像,然后反转图像并返回结果。 水平翻转图片就是将图片的每一行都进行翻转,即逆序。例如,水平翻转 [1, 1, 0] 的结果是 [0, 1, 1]。 反转图片的意思是图片中的 0 全部被 1 替换, 1 全部被 0 替换。例如,反转 [0, 1, 1] 的结果是 [1, 0, 0]

weixin_43447128的博客 175

Leetcode刷题 2021.02.19

Leetcode刷题 2021.02.19Leetcode1577 数的平方等于两数乘积的方法数Leetcode1626 无矛盾的最佳球队Leetcode1670 设计前中后队列 Leetcode1577 数的平方等于两数乘积的方法数 给你两个整数数组 nums1 和 nums2 ,请你返回根据以下规则形成的三元组的数目(类型 1 和类型 2 ): 类型 1:三元组 (i, j, k) ,如果 nums1[i]2 == nums2[j] * nums2[k] 其中 0 <= i < nums

weixin_43447128的博客 391

Leetcode刷题 2021.02.12

Leetcode刷题 2021.02.12Leetcode119 杨辉三角 IILeetcode870 优势洗牌Leetcode923 三数之和的多种可能 Leetcode119 杨辉三角 II 给定一个非负索引 k,其中 k ≤ 33,返回杨辉三角的第 k 行。 每日一题,杨辉三角应该是学编程的入门题了。记得上大一的时候,编个杨辉三角的作业,编了一晚上才写出来。真是难忘的回忆啊。 class Solution { public List<Integer> getRow(int ro

weixin_43447128的博客 1207

Leetcode刷题 2021.03.02

Leetcode刷题 2021.03.01Leetcode256 粉刷房子Leetcode150 逆波兰表达式求值Leetcode398 随机数索引 Leetcode256 粉刷房子 假如有一排房子,共 n 个,每个房子可以被粉刷成红色、蓝色或者绿色这三种颜色中的一种,你需要粉刷所有的房子并且使其相邻的两个房子颜色不能相同。 当然,因为市场上不同颜色油漆的价格不同,所以房子粉刷成不同颜色的花费成本也是不同的。每个房子粉刷成不同颜色的花费是以一个 n x 3 的矩阵来表示的。 例如,costs[0][0] 表

weixin_43447128的博客 304

Leetcode刷题 2021.02.10

Leetcode刷题 2021.02.10Leetcode846 一手顺子Leetcode1276 不浪费原料的汉堡制作方案Leetcode983 最低票价 Leetcode846 一手顺子 爱丽丝有一手(hand)由整数数组给定的牌。 现在她想把牌重新排列成组,使得每个组的大小都是 W,且由 W 张连续的牌组成。 如果她可以完成分组就返回 true,否则返回 false。 等会儿要回家过年了,不想断更,先记录一下吧。晚上或者明天再写思路和注释。 class Solution { public

weixin_43447128的博客 286

Leetcode刷题 2021.02.09

Leetcode刷题 2021.02.09Leetcode992 K 个不同整数的子数组Leetcode475 供暖器Leetcode1702 吃苹果的最大数目 Leetcode992 K 个不同整数的子数组 给定一个正整数数组 A,如果 A 的某个子数组中不同整数的个数恰好为 K,则称 A 的这个连续、不一定不同的子数组为好子数组。 (例如,[1,2,3,1,2] 中有 3 个不同的整数:1,2,以及 3。) 返回 A 中好子数组的数目。 明天要回家过年了,不知道有没有时间更新博客了,还是希望博客连续

weixin_43447128的博客 352

Leetcode刷题 2021.02.16

Leetcode刷题 2021.02.16Leetcode561 数组拆分 ILeetcode1400 构造 K 个回文字符串Leetcode1366 通过投票对团队排名 Leetcode561 数组拆分 I 给定长度为 2n 的整数数组 nums ,你的任务是将这些数分成 n 对, 例如 (a1, b1), (a2, b2), …, (an, bn) ,使得从 1 到 n 的 min(ai, bi) 总和最大。 返回该 最大总和 。 简单题。 class Solution { public i

weixin_43447128的博客 493

Leetcode刷题 2021.02.03

Leetcode刷题 2021.02.03Leetcode1300 转变数组后最接近目标值的数组和Leetcode1493 删掉一个元素以后全为 1 的最长子数组Leetcode480 滑动窗口中位数 Leetcode1300 转变数组后最接近目标值的数组和 给你一个整数数组 arr 和一个目标值 target ,请你返回一个整数 value ,使得将数组中所有大于 value 的值变成 value 后,数组的和最接近 target (最接近表示两者之差的绝对值最小)。 如果有多种使得和最接近 targ

weixin_43447128的博客 288

Leetcode刷题 2021.02.15

Leetcode刷题 2021.02.15Leetcode1758 生成交替二进制字符串的最少操作数Leetcode1760 袋子里最少数目的球Leetcode1759 统计同构子字符串的数目 Leetcode1758 生成交替二进制字符串的最少操作数 给你一个仅由字符 ‘0’ 和 ‘1’ 组成的字符串 s 。一步操作中,你可以将任一 ‘0’ 变成 ‘1’ ,或者将 ‘1’ 变成 ‘0’ 。 交替字符串 定义为:如果字符串中不存在相邻两个字符相等的情况,那么该字符串就是交替字符串。例如,字符串 “010

weixin_43447128的博客 579

Leetcode刷题 2021.02.23

Leetcode刷题 2021.02.23Leetcode1726 同积元组Leetcode334 递增的三元子序列Leetcode1328 破坏回文串 Leetcode1726 同积元组 给你一个由 不同 正整数组成的数组 nums ,请你返回满足 a * b = c * d 的元组 (a, b, c, d) 的数量。其中 a、b、c 和 d 都是 nums 中的元素,且 a != b != c != d 。 这类求相等和,相等积的对数的题。给的数据规模又不大的题,一定就是O(n^2),用map记录啦。

weixin_43447128的博客 409
上一篇: 2021_02_01 LeetCode刷题
下一篇: 2021_02_03 LeetCode刷题
Ls_attack
博客等级 码龄10年 25粉丝 81原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值