Advertisement
EmoRz

Magic_Exchangeable_Words

Jun 16th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace MagicExchangeableWords
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] inputWords = Console.ReadLine().Split();
  11.             var word1 = inputWords[0];
  12.             var word2 = inputWords[1];
  13.             //
  14.             HashSet<char> w1 = new HashSet<char>(word1);
  15.             HashSet<char> w2 = new HashSet<char>(word2);
  16.             var isExchangeble = w1.Count == w2.Count ?
  17.                 "true" : "false";
  18.             Console.WriteLine(isExchangeble);
  19.  
  20.  
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement