for _ in range(n)中 _ 是占位符, 表示不在意变量的值 只是用于循环遍历n次。 例如在一个序列中只想取头和尾,就可以使用_ 其实意思和for each in range(n)是一个意思,_只是一个代词,可以为each, 也可以为其它任意符合规范的符号,只是方便后续引用。 ————— ...
分类:
编程语言 时间:
2020-02-20 22:18:16
阅读次数:
127
1.前端不做处理, var roleIds = new Array(); $("input[name='uRole']:checked").each(function(index,element){ let roleId = $(element).attr("data-roId"); roleIds ...
分类:
编程语言 时间:
2020-02-20 20:05:14
阅读次数:
95
Given a string, we need to find the total number of its distinct substrings. 给你一个字符中,统计有多少个不同的子串InputT- number of test cases. T<=20;Each test case con ...
分类:
其他好文 时间:
2020-02-20 19:55:37
阅读次数:
59
1 """ 2 Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the ...
分类:
其他好文 时间:
2020-02-20 17:14:27
阅读次数:
75
一、JDK个版本之间的区别: 1.JDK1.5的新特性: 泛型ArrayList list = new ArrayList();-->ArrayList<int> list = new ArrayList<int>(); 自动装箱/拆箱 for - each static import(静态导入) ...
分类:
编程语言 时间:
2020-02-20 13:07:23
阅读次数:
84
用 return false, 不是 break。$.each(resArray, function(j, n) { if (1 == n) { return false; }}); ...
分类:
Web程序 时间:
2020-02-20 10:00:21
阅读次数:
69
题意 给定一个完美二叉树,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下: struct Node { int val; Node left; Node right; Node next; } 填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点 ...
分类:
其他好文 时间:
2020-02-19 15:17:58
阅读次数:
44
手册(有PHP4的实现方式哦):https://www.php.net/manual/zh/function.scandir.php 直接附代码吧PHP5和PHP7 直接有scandir()函数,遍历出当前目录下的所有文件。 function myScanDir($dir) { $file_arr ...
分类:
Web程序 时间:
2020-02-18 20:29:43
阅读次数:
87
Sub-string divisibilityThe number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it ... ...
分类:
其他好文 时间:
2020-02-18 16:25:35
阅读次数:
71
原题链接在这里:https://leetcode.com/problems/dice-roll-simulation/ 题目: A die simulator generates a random number from 1 to 6 for each roll. You introduced a ...
分类:
其他好文 时间:
2020-02-18 14:53:26
阅读次数:
60