Closed

perform a task

Question:

Coding Exercise:

Questions: Understand the code snippet below and do as instructed in ‘TODO’ section.

Code Snippet:

a = [1,2,3,4,10,20,30] # random length between 1 to 10,000, random content 1 to 10,000

b = [20,30,1,2,1,3,4,4,5]

def mergeCounter(a,b):

response = {}

# Rules:

# modify of array a and b is not allowed

# merge of a and b is not allowed

# you can only use one loop

###

# TODO: Implement this function in below section

###

# Output:

# Key: number

# value: frequency of key from array a and b

# Example:

# a = [1,2,1,5]

# b = [1,3,3,4,5]

# response = {1:3,2:1,5:2,3:2,4:1}

return response

# Testing

mergeCounter (a,b)

Code for this possibly

public static Map<Integer, Integer> mergeCounter(int[] a, int[] b){

Map<Integer, Integer> dupMap = new HashMap<Integer, Integer>();

if(a!=null && b!=null){

int n = [url removed, login to view],m=[url removed, login to view];

int max=0;

if(n>m)

max=n;

else

max =m;

for(int i = 0; i<max;i++){

if(i<n){

if([url removed, login to view](a[i]))

[url removed, login to view](a[i], [url removed, login to view](a[i])+1);

else

[url removed, login to view](a[i], 1);

}

if(i<m){

if([url removed, login to view](b[i]))

[url removed, login to view](b[i], [url removed, login to view](b[i])+1);

else

[url removed, login to view](b[i], 1);

}

}

/*for (Entry<Integer, Integer> entry : [url removed, login to view]()){

[url removed, login to view]([url removed, login to view]() + ":" + [url removed, login to view]());

}*/

}

return dupMap;

}

need to write test cases for this using selenium JUnit in eclipse

Skills: Coding, Google Maps API, Software Architecture, Software Development, Testing / QA

See more: implement function randomgraphgenerator, implement class write test program creates points, error joomla function failed error number 1030, design implement application reads arbitrary number integers range, function failed error number 145 mysql, image coding number, excel function predict next number, joomla function failed error number 126, function failed error number 145, jquery perform task multiple checkboxes table, implement function excel, aspnet function output, coding shows value drop_down menu update php, fast learner perform task fast, call dll function output parameter

About the Employer:
( 2 reviews ) Hammond, United States

Project ID: #15271865

6 freelancers are bidding on average $94 for this job

A2Design

Hello, We are a team of 30 developers based in Russia. We specialise in: PHP & PHP frameworks, WordPress & Woocommerce, Opencart, Magento, API development, HTML5, CSS, JavaScript, Bootstrap, MySQL, etc. Get to kno More

$350 USD in 3 days
(15 Reviews)
6.4
utkarshkatiyar19

hi, i have 6 years of experience writing code using java. i also have experience working with selenium in java. so i can do the required task for [url removed, login to view] can discuss more in chat. thanks Relevant Skills and Experience More

$60 USD in 1 day
(21 Reviews)
4.7
$25 USD in 1 day
(13 Reviews)
4.2
portasovgrigoriy

Good morning. I am concerning your project. I have faced the same question recently and have found a good specialist. It occurred not so easy to do. Try to contact Anton Cheprasov cheprassovv@([url removed, login to view]) They work quali More

$25 USD in 10 days
(0 Reviews)
0.0
henryfreelancer8

What is being requested combines two techniques i am very used to which are white box testing and code debugging.

$77 USD in 4 days
(0 Reviews)
0.0
$25 USD in 10 days
(0 Reviews)
0.0