This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number[][]} nums | |
* @param {number} r | |
* @param {number} c | |
* @return {number[][]} | |
*/ | |
var matrixReshape = function(nums, r, c) | |
{ | |
var len = nums.length | |
var element_num = nums[0].length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number[]} nums | |
* @param {number} target | |
* @return {number[]} | |
*/ | |
var twoSum = function(nums, target) { | |
len = nums.length; | |
//console.log(len) | |
var res = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number[]} nums | |
* @return {number} | |
*/ | |
var removeDuplicates = function(nums) { | |
//indexOf,利用这个方法,获取某个元素在数组中的位置; | |
len = nums.length; | |
a = []; | |
for (i = 0; i < len; i ++) | |
{ |