• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 30, 2023 |1.5K Views
SDE Sheet - Minimum Swaps
  Share  1 Like
Description
Discussion

This video is part of Graphs section under GFG SDE Sheet.

In this video, we are given an array of n distinct elements. Find the minimum number of swaps required to sort the array in strictly increasing order.

Example :

Input:
nums = {2, 8, 5, 4}
Output:
1

Explaination:
swap 8 with 4.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/minimum-number-swaps-required-sort-array/
Problem: https://practice.geeksforgeeks.org/problems/minimum-swaps/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

 

Read More