Advertisement
YavorGrancharov

Magic_exchangeable_words

Oct 27th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Magic_exchangeable_words
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             string[] input = Console.ReadLine().Split().ToArray();
  12.             Console.WriteLine(areExchangeable(input).ToString().ToLower());
  13.            
  14.         }
  15.         public static Boolean areExchangeable(string[] input)
  16.         {
  17.             var left = input[0].Distinct().ToArray();
  18.             var right = input[1].Distinct().ToArray();
  19.  
  20.             if (left.Length == right.Length)
  21.             {
  22.                 return true;
  23.             }
  24.             else
  25.             {
  26.                 return false;
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement