This file contains hidden or 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 processData(input) { | |
//Enter your code here | |
/* | |
2 5 | |
1 0 5 | |
1 1 7 | |
1 0 3 | |
2 1 0 | |
2 1 1 | |
*/ |
This file contains hidden or 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
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
This file contains hidden or 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 processData(input) { | |
//Enter your code here | |
let rows = input.split("\n"); | |
let stringCount = parseInt(rows[0]); | |
let queryOccursCount=[]; | |
let queryCount=parseInt(rows[stringCount+1]); | |
//console.log("qc:"+ queryCount); | |
for(q=0;q<queryCount;q++){ | |
queryOccursCount.push(parseInt(0)); | |
This file contains hidden or 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
// https://www.hackerrank.com/amansbhandari?hr_r=1 | |
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { |
This file contains hidden or 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
var A = [1,2,3,4,5,6,7,8,9]; | |
var B=[]; | |
var ALength = A.length; | |
for(var xcv=1;xcv<=ALength;xcv++) { | |
B.push(A[ALength-xcv]); | |
} | |
console.log(B); |
This file contains hidden or 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
var A = [1,2,3,4,5,6,7,8,9]; | |
var x =[]; | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); | |
x.push(A.pop()); |
This file contains hidden or 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
var A = [1,2,3,4,5,6,7,8,9]; | |
var x =[A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop()]; | |
console.log(x); |
This file contains hidden or 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
var A = [1,2,3,4,5,6,7,8,9]; | |
A.push(A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop(),A.pop()); | |
console.log(A); |
This file contains hidden or 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 correct(income){ | |
income=income.toString(); | |
if(income.length<2){income = "0"+income} | |
return income; | |
} | |
window.addEventListener('load',function(){ | |
var targetElementId='OclockDiv'; | |
var refreshFrequency=1000; //1 second =1000miliseconds | |
window.setInterval(function(){ |
This file contains hidden or 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 fizzBuzz(num){ | |
var message=""; | |
for(x=1; x<=num; x++){ | |
// if(x%3==0 && x%5!=0){console.log('Fizz');} | |
// if(x%5==0 && x%3!=0){console.log('Buzz');} | |
// if(x%3==0 && x%5==0){console.log('FizzBuzz');} | |
// if(x%3!=0 && x%5!=0){console.log(x);} | |
p = (x%3==0); | |
q = (x%5==0); |