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
/* | |
Original URL: https://www.hackerrank.com/challenges/between-two-sets/problem | |
Consider two sets of positive integers, and . We say that a positive integer, , is between sets and if the following conditions are satisfied: | |
All elements in are factors of . | |
is a factor of all elements in . | |
In other words, some is between and if that value of satisfies for every in and also satisfies for every in . For example, if and , then our possible values are and . | |
Given and , find and print the number of integers (i.e., possible 's) that are between the two sets. |
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
aramaSeti="araba,bal�k,ferrari,jeton,kelaynak" | |
' aranacak kelimeler �nce url tipi karakterler ta��mal� TR karakterler ve bo�luklar �evrilmeli | |
linkTemelAdresi ="http://news.google.com/news/search?pz=1&cf=all&ned=tr_tr&hl=tr&q=" | |
arananlar = split(aramaSeti,",") | |
For araNo=0 to UBound(arananlar)-1 | |
Dim objHttp | |
Set objHttp = CreateObject("Msxml2.ServerXMLHTTP") | |
objHttp.Open "GET", linkTemelAdresi & arananlar(araNo), False | |
msgbox(linkTemelAdresi & arananlar(araNo)) |
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
/** | |
Given an array of integers, return indices of the two numbers such that they add up to a specific target. | |
You may assume that each input would have exactly one solution, and you may not use the same element twice. | |
Example: | |
Given nums = [2, 7, 11, 15], target = 9, | |
Because nums[0] + nums[1] = 2 + 7 = 9, | |
return [0, 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
var isValid = function(s) { | |
var rV=true; // default | |
var f=''; | |
for(var x=0; x<s.length; x++){ | |
if('()[]{}'.indexOf(s[x])>-1){ | |
f+=s[x]; | |
} | |
} | |
while((f.indexOf('[]')>=0) || (f.indexOf('()')>=0) || (f.indexOf('{}')>=0)){ | |
f=f.replace('[]','');f=f.replace('()','');f=f.replace('{}',''); |
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
/** | |
* @param {number[]} temperatures | |
* @return {number[]} | |
*/ | |
var dailyTemperatures = function(temperatures) { | |
let outPut = []; | |
//let test=[]; | |
const howMany = temperatures.length; | |
temperatures.forEach(function(i,index){ |
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
/** | |
* @param {number[]} findNums | |
* @param {number[]} nums | |
* @return {number[]} | |
*/ | |
var nextGreaterElement = function(findNums, nums) { | |
const fNLength = findNums.length; | |
const nLength = nums.length; | |
let outPut = []; | |
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 dec2bin(dec){ | |
"use strict"; | |
return dec.toString(2); | |
} | |
function bin2dec(bin){ | |
"use strict"; | |
return parseInt(bin,2); | |
} |
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
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
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; | |
}); |