-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathchallenge.js
53 lines (45 loc) · 8.97 KB
/
challenge.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
console.log('hey')
let boys = 0
let girls = 0
for (let i = 0; i < 1000; i++) {
while (true) {
let boy = Math.random() >= 0.5
if (boy) {
boys++
} else {
girls++
break
}
}
}
console.log({boys,girls})
// // let text = "srASBpeThwTwhdZVPOaECJhGnxhRKzxrbMSDyGZGNZBbCOKvPpJKKaQEcoLGBfIiKtpVsROccWwgrWdEqtNFskeDnFbfKWVEeLvtBUlWrOMgtxsaSkctfJQfdOGRNMzeBlFsCFafWXzvrGfazhEruTMOETzZRYnuHsrtHeYivQdXFnwdDslSSGpfOMyrhbgkOnPiwDTzUBbRaJzGbvUGmVzzTPRaXmLZsXyElKjzwXUYUqiuggHiSzHiGSuQhgHTICVWIjVXMUXOQhPdEskSprJHQvvtRtNQEVUwkGGqDUrAXzWTMyUYIisiOxlTHcIsFfSnhzmCgEwmoWChrqkyNdtdLFWErzlEprlTNZsPfedCDEsqvmLWmxgCxpmSPTjGSxtXINfaDztBUNdiQWoaIgFkqajwhInhMzczvmTJjwgtSGGoIbozCJgVurJetNXSXWeduNjPVlpZtDimsizGqUjaLjYWvlRdYdrWvHzNUnKOlAUpTBMkUNFqYLvQKoQiPPwvndXenRCVaBotNEKkJPUrYnaWAgizfeHyQMoFICbCqKELTmUYvqPYpzKVBYPTLxRLMyexgApRCWDjhQAsDQhRGStiyGMEAWoBLFpsdbGGxFbgIarMglYofcZXILlFlCvkCkCXybTKiYrHLpWXbngLJyVIzhwPIqSQlHURyrrtBTUbyrmMEquLvVjfKrRzTzVoiknxpIICbQGfptEtwvpvUkeqOvtCOuArDtavZFszWBStWtqEGLIdKuVMTFRXhOWPpjHcEWmthjrKXEnfeNKDmPEyvneMQrDBG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rClqLATvPhoZRtixXiQYejsarnKOoYIifvLeGISmmeQNCMAkqLxRQrnEkmgFLCNCjWCtrDMEIfczvJgtlGWDsTbSEUKvWEIhOhMszkXUCcVhACkLKQJqSxkujXpTshKYRmuadwaBQSvkIPFRPtDaSYvgJXxmsHFngRdxiQFgCugHlKOWXpJeTkDWuZhzFKedytKzEuUQDiJmwkYUvDYZpTWshnJdBlZmnoTKgcwFrasjBpQyPTAKPDBFPfLzCepkPTHTQAqVMMFXUunEgOjOyrcsbIZzPEREiymQYmBjiDtYCjAJVIQgHlhvYvLFXRjJwejJegVjoycbVqEvxKEdkLrFsoMxWeKBcHeMLcIvtZXXTJOXhpzaiMBTjBHVsOgNWzbRfAbAiNeEBpWnysbeNbuRpTRCAYWKcqcnzXWkRWvlVtHjwSObEWanCJSLrwZoBpNiTSTYntvJJZNCNspCFDqQnAMMqpvPQWtbpsaMwzECdxXcKbbeQkskLALCZrzCNfdYOxEayHHkRNF"
// // let matches = /[a-z]{4}[A-Z]{4}/.exec(text)
// // console.log(JSON.stringify(matches))
// let https = require('https')
// function next(code) {
// var options = {
// host: `challenge.hiringsolved.com`,
// path: `/breadcrumbs/${code}`
// }
// https.get(options, function (res) {
// var data = '';
// res.on('data', function (chunk) {
// data += chunk;
// })
// res.on('end', function () {
// let nextCode = data.split(' ').pop()
// console.log('----------------------')
// console.log(data)
// // console.log('nextCode: ' + nextCode)
// if (nextCode != '12345') {
// next(nextCode)
// }
// })
// }).on('error', function (e) {
// console.log("Got error: " + e.message);
// })
// }
// // next(62605)
// next(53781)
// // https://challenge.hiringsolved.com/monster