Check if two arrays are equal or not | SDE Sheet | Arrays
source link: https://www.geeksforgeeks.org/videos/check-if-two-arrays-are-equal-or-not/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
- 60 Views
- 13/04/2022
In this video we will see how to find if two given arrays of equal length are equal or not. Two arrays are said to be equal if both of them contain the same set of elements, arrangements (or permutation) of elements may be different though.
Example: Input : arr1[] = {1, 2, 5, 4, 0}; arr2[] = {2, 4, 5, 0, 1}; Output : Yes
Input : arr1[] = {1, 7, 1}; arr2[] = {7, 7, 1}; Output : No
Check out the video to see how we implement this!!
Practice Problem: https://practice.geeksforgeeks.org/problems/check-if-two-arrays-are-equal-or-not3847/1 Article: https://www.geeksforgeeks.org/check-if-two-arrays-are-equal-or-not/ SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK