Advertisement
martinvalchev

Magic_exchangeable_words

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