# 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

( 2 reviews ) Hammond, United States

Project ID: #15271865

## 5 freelancers are bidding on average \$107 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 [login to view URL] can discuss more in chat. thanks Relevant Skills and Experience More

\$60 USD in 1 day
(25 Reviews)
4.8
\$25 USD in 1 day
(13 Reviews)
4.2
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