You are on page 1of 4

bash .

install_sh
user@workspaceql5fp555wx3c76a5:/projects/challenge$ bash .install_sh
user@workspaceql5fp555wx3c76a5:/projects/challenge$ cd linkedlist_java
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git push origin
master Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 2 threads.Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 1.06 KiB | 1.06 MiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To ../.assessment/remote
* [new branch] master -> master
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git checkout -b
new_branch
Switched to a new branch 'new_branch'
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git status
On branch new_branch
nothing to commit, working tree clean
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git status
On branch new_branch
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: linked_list/LinkedList.java

no changes added to commit (use "git add" and/or "git commit -a")
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git add .
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git status
On branch new_branch
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: linked_list/LinkedList.java

user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git commit -m


"initial commit"
[new_branch 737876b] initial commit
1 file changed, 1 insertion(+), 1 deletion(-)
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$ git push origin
new_branch
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 370 bytes | 370.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0)
To ../.assessment/remote
* [new branch] new_branch -> new_branch
user@workspaceql5fp555wx3c76a5:/projects/challenge/linkedlist_java$

kafka #Write your script here


#Kafka root folder is located at : /opt/mdp/kafka_2.11-1.0.0
#Run install once before executing your script
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "test_topic"
exit 1
fi

nohup bin/zookeeper-server-start.sh -daemon config/zookeeper.properties > /dev/null


2>&1 &
sleep 2
nohup bin/kafka-server-start.sh -daemon config/server.properties > /dev/null 2>&1 &
sleep 2

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --


partitions 2 --topic $1
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --
partitions 2 --topic parsed

/opt/mdp/kafka_2.11-1.0.0/bin/zookeeper-server-start.sh -daemon
config/zookeeper.properties > /dev/null
/opt/mdp/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon
config/server.properties > /dev/null

/opt/mdp/kafka_2.11-1.0.0/bin/kafka-topics.sh --create --zookeeper localhost:2181


--replication-factor 1 --partitions 2 --topic $1

'use strict';

const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';


let currentLine = 0;

process.stdin.on('data', function(inputStdin) {
inputString += inputStdin;
});

process.stdin.on('end', function() {
inputString = inputString.split('\n');

main();
});

function readLine() {
return inputString[currentLine++];
}

weird faculty javascript: milstone:


'use strict';
const fs = require('fs');

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';


let currentLine = 0;

process.stdin.on('data', function(inputStdin) {
inputString += inputStdin;
});

process.stdin.on('end', function() {
inputString = inputString.split('\n');

main();
});

function readLine() {
return inputString[currentLine++];
}

/*
* Complete the 'exam' function below.
*
* The function is expected to return an INTEGER.
* The function accepts INTEGER_ARRAY v as parameter.
*/

function exam(v) {
var a = (function (s) { var a = []; while (s-- > 0)
a.push(null); return a; })(/* size */ v.length);
a = /* toArray */ (function (a1, a2) { if (a1.length >= a2.length) {
a1.length = 0;
a1.push.apply(a1, a2);
return a1;
}
else {
return a2.slice(0);
} })(a, v);
var n = a.length;
var onesUntilIndex = (function (s) { var a = []; while (s-- > 0)
a.push(0); return a; })(n + 1);
for (var i = 1; i <= n; i++) {
{
onesUntilIndex[i] = a[i - 1] === 1 ? onesUntilIndex[i - 1] + 1 :
onesUntilIndex[i - 1];
}
;
}
var k = 0;
for (var i = 0; i <= n; i++) {
{
var your_ones = onesUntilIndex[i];
var you_zeros = i - your_ones;
var your_sum = your_ones - you_zeros;
var friend_ones = onesUntilIndex[n] - your_ones;
var friend_zeros = (n - i) - friend_ones;
var friend_sum = friend_ones - friend_zeros;
if (your_sum > friend_sum) {
k = i;
break;
}
}
;
}
return k;

function main() {

You might also like