Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Mirror Inverse Program in c#

// C# implementation of the approach
using System;
 
class GFG
{
     
    // Function that returns true if
    // the array is mirror-inverse
    static bool isMirrorInverse(int []arr)
    {
        for (int i = 0; i < arr.Length; i++)
        {
 
            // If condition fails for any element
            if (arr[arr[i]] != i)
                return false;
        }
 
        // Given array is mirror-inverse
        return true;
    }
 
    // Driver code
    static public void Main ()
    {
        int []arr = { 1, 2, 3, 0 };
        if (isMirrorInverse(arr))
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");
    }
}
 
// This code is contributed by ajit...
Comment

PREVIOUS NEXT
Code Example
Csharp :: ef core unique index 
Csharp :: unity button text changes when clicked 
Csharp :: orderby make sunday last day c# 
Csharp :: Razor do while loop 
Csharp :: Unity Scale per code ändern 
Csharp :: c# check word length 
Csharp :: Dynamically checking IList<T C# 
Csharp :: c# check number is odd or even 
Csharp :: percentage random c# 
Csharp :: attributes C# reflection variable update site:stackoverflow.com 
Csharp :: c# lernen kostenlos 
Csharp :: game creator change local variable 
Csharp :: list remove positions c# 
Csharp :: prime number generator 
Csharp :: unity int to bool 
Csharp :: shallow copy vs deep copy c# 
Csharp :: copy file 
Csharp :: how to make play button in unity 
Csharp :: c# is not marked as serializable 
Csharp :: convert uk string date to DateTime c# 
Csharp :: c# web page show 2nd page of tiff on an image control 
Csharp :: polling data source c# using threads 
Html :: href do nothing 
Html :: copyright footer html code 
Html :: how to stop download option in video tag of HTML 
Html :: html tab space 
Html :: how to add favicon in html 
Html :: lock the zoom html 
Html :: html lien 
Html :: flex direction column bootstrap 4 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =