Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2016
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. class C
  4. {
  5. static void Main()
  6. {
  7. string i = Console.ReadLine();
  8.  
  9. int k = i.Distinct().Count();
  10.  
  11. if (k != 1)
  12. {
  13. int x = 0;
  14. int o = i.Select(c => i.Remove(x++, 1)).Any(s => s.Reverse().SequenceEqual(s)) ? x : 0;
  15. Console.WriteLine(x - 1);
  16. }
  17. else
  18. {
  19. Console.WriteLine(-1);
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement