Problem about unique integers given two arrays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Souloma30
    New Member
    • Nov 2020
    • 1

    Problem about unique integers given two arrays

    Given two arrays (the first array and the second array) of the same size,
    each consisting of n positive integers, I want to write a c++ program to determine how many unique integers the second array have. Here a unique integer means that it shows only once in the second array but does not show in the first array. For example, if the first array is [1, 5, 3, 6, 8] and the second array is [2, 4, 2, 5, 9] (with n=5), the second array
    has two unique integers (4 and 9)
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    Given two arrays (the first array and the second array) of the same size,
    each consisting of n positive integers, I want to write a c++ program to determine how many unique integers the second array have. Here a unique integer means that it shows only once in the second array but does not show in the first array. For example, if the first array is [1, 5, 3, 6, 8] and the second array is [2, 4, 2, 5, 9] (with n=5), the second array
    has two unique integers (4 and 9)
    Select an element from the second. Compare it with every element in the first. If there's no match, check for the repetition.

    Comment

    • AjayGohil
      New Member
      • Apr 2019
      • 83

      #3
      Hello,

      For this you have to find unique element in second array. for finding unique element refer following site:

      Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.


      For finding unique element in second array which are not present in first array refer following site:

      Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.


      Thank you

      Comment

      Working...