InterviewSolution
Saved Bookmarks
| 1. |
Write a c program to print an array to find repeated and missing value input: output : 1 2 3 4 4 4 5 |
|
Answer» Given an unsorted array of size n. Array elements are in the range from 1 to n. One NUMBER from set {1, 2, …n} is missing and one number occurs twice in the array. Find these two numbers.Examples: Input: ARR[] = {3, 1, 3}Output: Missing = 2, Repeating = 3Explanation: In the array, 2 is missing and 3 occurs twice Input: arr[] = {4, 3, 6, 2, 1, 1}Output: Missing = 5, Repeating = 1hope this HELP you |
|