码迷,mamicode.com
首页 >  
搜索关键字:while break continue    ( 40024个结果
Leetcode: 1424. Diagonal Traverse II
Description 题目见 https://leetcode.com/problems/diagonal-traverse-ii/ code 这是考验智商的题目~~ 我的代码 import bisect class Solution(object): def findDiagonalOrder( ...
分类:其他好文   时间:2021-03-09 12:53:59    阅读次数:0
13-
1-求 1000 以内所有质数的和 var f = false;var i = 2;var j = 2;var n = 0;while (i < 1000) {f = true;while (j <= i/2){if (i % j == 0){f = false;break;}j++;} if (f ...
分类:其他好文   时间:2021-03-09 12:53:40    阅读次数:0
双指针 四数之和
题目 LeetCode 18. 四数之和 给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 target 相等?找出所有满足条件且不重复的四元组。 注意: 答案中不可以包含重复的四 ...
分类:其他好文   时间:2021-03-08 13:46:39    阅读次数:0
双指针 三数之和
题目 LeetCode 15. 三数之和 给你一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?请你找出所有和为 0 且不重复的三元组。 注意:答案中不可以包含重复的三元组。 示例 1: 输入:nums = [-1,0,1,2 ...
分类:其他好文   时间:2021-03-08 13:46:05    阅读次数:0
Core Python | 2 - Core Python: Getting Started | 2.6 - Objects and Types | 2.6.4 - Python's Type System
Programming languages can be distinguished by several characteristics, but one of the most important is the nature of their type system. Python could ...
分类:编程语言   时间:2021-03-08 13:34:24    阅读次数:0
数论:入门到入土 Three
超短文警告! 埃氏筛: #include <iostream> #include <cstring> #include <stdio.h> #define HRiver2 return #define Warma 0 #define ll long long #define maxn 114514 ...
分类:其他好文   时间:2021-03-08 13:23:25    阅读次数:0
LeetCode 344. 反转字符串
思路 方法:首尾双指针 1 class Solution { 2 public: 3 void reverseString(vector<char>& s) { 4 int i = 0, j = s.size()-1; 5 while(i < j) { 6 swap(s[i], s[j]); 7 + ...
分类:其他好文   时间:2021-03-08 13:22:36    阅读次数:0
leetcode(1)——两数之和, 20210301
题目描述 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 示例: 给定 nums = [2, 7, 11, 15], target = 9因为 nu ...
分类:其他好文   时间:2021-03-08 13:14:30    阅读次数:0
arduino ttl_to rs-485 模块
/* 【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程) 实验七十六:TTL转RS-485模块 MAX485 RS485模块 将Arduino上的数字引脚10、11设置为软串口RX和TX与MAX485模块上的RO和DI连接 MAX485模块上的RE和DE连接在一起用一个引脚 ...
分类:其他好文   时间:2021-03-08 13:03:25    阅读次数:0
java-流程控制
1.Scanner java.util.scanner是java5的心特征,scanner可以用来获取用户的输入。 通过Scanner类的next()与nexLine()方法来获取输入的字符串。 通过hasNext()与hasNextline()判断是否还有输入的数据。 next()方法会去掉空格后 ...
分类:编程语言   时间:2021-03-06 15:04:34    阅读次数:0
40024条   上一页 1 ... 38 39 40 41 42 ... 4003 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!