Question: // you can write to stdout for debugging purposes, e.g. // console.log('this is a debug message'); task3 solution.js I test-input.txt Bob would like to add

 // you can write to stdout for debugging purposes, e.g. //

// you can write to stdout for debugging purposes, e.g. // console.log('this is a debug message'); task3 solution.js I test-input.txt Bob would like to add as few letters as possible. In the example above, Bob added two letters, which is the minimum possible. Your task is to tell him the minimum number of letters that he needs to add to make the given words anagrams in this way. Write a function: function solution(A, B) { // write your code in JavaScript (Node.js 1.9.4) } function solution (A, B); II that, given two non-empty strings, A and B, consisting of N and M letters respectively, returns the minimum number of letters that Bob has to add to the words specified in A and B to make them anagrams. For example, given the words "rather" and 'harder' your function should return 2, as explained above. For the given words "apple" and "pear" your function should return 3, since you can add the letter 'r' to the first word and the letters 'p' and 'i'to the second word to form anagrams. And for the given words "lemon" and 'melon", your function should return O, since the given words are already anagrams. Write an efficient algorithm for the following assumptions: N and M are integers within the range (1...100,000); string ('A', 'B') consists only of lowercase letters (a-z). Test Output Run Tests

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!