US States Puzzle

Originally taken from

http://interviewpattern.com/post/Puzzles-and-Riddles-on-the-interview-(Part-e28093-I).aspx

Take the names of two U.S. States, mix them all together, then rearrange the letters to form the names of two other U.S. States.

What states are these?

using our Combinatorics library 

using System;
using System;
using System.Collections.Generic;
using System.Linq;

namespace StatePuzzle
{
internal class Program
{
    private static void Main(string[] args)
    {
        var listStates = new List
            {
            "Alabama","Alaska","AmericanSamoa","Arizona","Arkansas","California",
            "Colorado","Connecticut","Delaware","DistrictofColumbia","Florida",
            "Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa",
            "Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts",
            "Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska",
            "Nevada","NewHampshire","NewJersey","NewMexico","NewYork","NorthCarolina",
            "NorthDakota","Ohio","Oklahoma","Oregon","Pennsylvania",
            "PuertoRico","RhodeIsland","SouthCarolina","SouthDakota","Tennessee",
            "Texas","Utah","Vermont","Virginia","VirginIslands","Washington",
            "WestVirginia","Wisconsin","Wyoming"
            };

        foreach (var statePair in Combinatorics.Combinations(listStates, 2))
        {

            var chars = string.Join(string.Empty, statePair.ToArray())
                        .ToLower()
                        .ToCharArray()
                        .OrderBy(c => c);

            var toSearch = listStates.Except(statePair).ToList();

            foreach (var statePairSeach in Combinatorics.Combinations(toSearch, 2))
            {

                var charsSearch = string.Join(string.Empty, statePairSeach.ToArray())
                                .ToLower()
                                .ToCharArray()
                                .OrderBy(c => c);
                if( chars.Count() == charsSearch.Count() && 
                    chars.SequenceEqual(charsSearch))
                {
                    Console.Write("Letters that make up the States :");
                    Console.Write(string.Join(",", statePair.ToArray()));
                    Console.WriteLine("");
                    Console.Write("Can be re-arranged to read :");
                    Console.Write(string.Join(",", statePairSeach.ToArray()));
                    Console.WriteLine("");
                    Console.WriteLine("");
                }
            }
        }

        Console.ReadLine();
    }
}
}