Advertisement
Guest User

Untitled

a guest
Oct 19th, 2016
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Globalization;
  8. using System.IO;
  9.  
  10.  
  11. namespace ConsoleApplication1
  12. {
  13. class Program
  14. {
  15. static void Main(string[] args)
  16. {
  17. string[] words = Console.ReadLine ().Split ();
  18. char[] first = words [0].ToCharArray ();
  19. char[] second = words [1].ToCharArray ();
  20.  
  21. var list1 = new List<char> ();
  22. var list2 = new List<char> ();
  23.  
  24. for (int i = 0; i < first.Length; i++) {
  25. if (!list1.Any(x => x == first[i])) {
  26. list1.Add (first [i]);
  27. }
  28. }
  29. for (int i = 0; i < second.Length; i++) {
  30. if (!list2.Any(x => x == second[i])) {
  31. list2.Add (second [i]);
  32. }
  33. }
  34. if (list1.Count == list2.Count)
  35. Console.WriteLine ("true");
  36. else
  37. Console.WriteLine ("false");
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement