Skip to content

Instantly share code, notes, and snippets.

View Cihatata's full-sized avatar
🎯
Focusing

Cihat ATA Cihatata

🎯
Focusing
View GitHub Profile
@Cihatata
Cihatata / timeConversion.js
Created August 17, 2020 09:46
Time Conversion AM/PM Convert Javascript HackerRank
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(":");
@Cihatata
Cihatata / plusMinus.js
Created August 16, 2020 16:02
Hacker Rank Plus Minus JS [SOLVED]
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++;
@Cihatata
Cihatata / diagonalDiffrence.js
Created August 16, 2020 15:41
HackerRank Diagonal Difference js [SOLVED]
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];
}