4 kyu

Connect Four

769 of 5,860aryan-firouzian

Description:

Connect Four

Take a look at wiki description of Connect Four game:

Wiki Connect Four

The grid is 6 row by 7 columns, those being named from A to G.

You will receive a list of strings showing the order of the pieces which dropped in columns:

std::vector<std::string> pieces_position_list
{
  "A_Red",
  "B_Yellow",
  "A_Red",
  "B_Yellow",
  "A_Red",
  "B_Yellow",
  "G_Red",
  "B_Yellow"
}
List<string> myList = new List<string>()
{
    "A_Red",
    "B_Yellow",
    "A_Red",
    "B_Yellow",
    "A_Red",
    "B_Yellow",
    "G_Red",
    "B_Yellow"
};
List<String> myList = new ArrayList<String>(Arrays.asList(
    "A_Red",
    "B_Yellow",
    "A_Red",
    "B_Yellow",
    "A_Red",
    "B_Yellow",
    "G_Red",
    "B_Yellow"
));
  piecesPositionList = ["A_Red",
                        "B_Yellow",
                        "A_Red",
                        "B_Yellow",
                        "A_Red",
                        "B_Yellow",
                        "G_Red",
                        "B_Yellow"]
  pieces_position_list = ["A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "G_Red",
                          "B_Yellow"]
  pieces_position_list = ["A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "G_Red",
                          "B_Yellow"]
  $piecesPositionList  = ["A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "A_Red",
                          "B_Yellow",
                          "G_Red",
                          "B_Yellow"];

The list may contain up to 42 moves and shows the order the players are playing.

The first player who connects four items of the same color is the winner.

You should return "Yellow", "Red" or "Draw" accordingly.

Fundamentals

Stats:

CreatedJan 2, 2016
PublishedJan 2, 2016
Warriors Trained29796
Total Skips10682
Total Code Submissions88622
Total Times Completed5860
C# Completions769
JavaScript Completions1224
Ruby Completions134
C++ Completions674
Python Completions2231
Java Completions718
PHP Completions184
Total Stars1102
% of votes with a positive feedback rating93% of 916
Total "Very Satisfied" Votes799
Total "Somewhat Satisfied" Votes99
Total "Not Satisfied" Votes18
Total Rank Assessments8
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • aryan-firouzian Avatar
  • jhoffner Avatar
  • user5036852 Avatar
  • 00dev Avatar
  • Blind4Basics Avatar
  • Firefly2002 Avatar
  • Torkel Avatar
  • MattZ306 Avatar
  • hobovsky Avatar
  • Welpy Avatar
Ad