Python Solution

No Idea! HackerRank Python Solutions

3

Hello Friends, How are you? Today I am going to solve the HackerRank No Idea Python Problem with a very easy explanation. In this article, you will get one or more approaches to solving this problem. So let’s start- {tocify} $title={Table of Contents}

There is an array of n integers. There are also 2 disjoint sets, A and B, each containing m integers. You like all the integers in set A and dislike all the integers in set B. Your initial happiness is 0. For each i integer in the array, if i belongs to A, you add 1 to your happiness. If i belongs to B, you add -1 to your happiness. Otherwise, your happiness does not change. Output your final happiness at the end. Note: Since A and B are sets, they have no repeated elements. However, the array might contain duplicate elements. The first line contains integers n and m separated by a space. The second line contains n integers, the elements of the array. The third and fourth lines contain m integers, A and B, respectively. 1

Related Articles

Python Solution

Validating Postal Codes! Python HackerRank Solution

Hello Friends, How are you? Today I am going to solve the HackerRank...

Python Solution

Check Strict Superset in Python HackerRank Solutions

Hello Friends, How are you? Today I am going to solve the HackerRank...

Python Solution

Write a function | HackerRank Python Solution

Hello Friends, How are you? Today I am going to solve the HackerRank...

Python Solution

Company Logo – Python HackerRank Solution

Hello Friends, How are you? Today I am going to solve the HackerRank...