Tutorial of Array Permutation

Prerequisite: Implementation
Editorial: We already know that a permutation of N is 1 to N number that exactly once appears in the set.
For example, if N = 4, then permutation = {1, 2, 3, 4}.
Since the given numbers are 1 to N in the array, check for any duplicate numbers available in the array.
If there are any duplicate numbers available in the array, that means the array is not a permutation of N.
Time Complexity : O(N)
Code (C++) : Available in the Solutions Section.

0 comments

No comments so far...

Information

ID
1055
Difficulty
2
Category
Beginners দেখানোর জন্য ক্লিক করুন
Tags
(None)
# Submissions
95
Accepted
56
Accepted Ratio
59%
Uploaded By