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
function timeConversion(s) { | |
let timeArr = s.split(":"); | |
let sec = (timeArr[2][0] + timeArr[2][1]); | |
let timeFormat = s.slice(-2); | |
let time = { | |
hours: timeArr[0], | |
min: timeArr[1], | |
sec, | |
timeFormat,function timeConversion(s) { | |
let timeArr = s.split(":"); |
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
function plusMinus(arr) { | |
let positive = 0; | |
let negative = 0; | |
let zero = 0; | |
let len = arr.length; | |
arr.forEach((item) => { | |
if (item>0) { | |
positive++; | |
} else if (item<0) { | |
negative++; |
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
function diagonalDifference(arr) { | |
// Write your code here | |
let right=0; | |
let left=0; | |
let len = arr.length; | |
for(var i=0;i<len;i++){ | |
for(var j=0;j<len;j++){ | |
if(i - j == 0) { | |
left = left +arr[i][j]; | |
} |