Problem Description: Arif likes to play volley ball. He found some statistics of matches which described who won the points in order. A game shall be won by the player first scoring 11 points except in the case when both players have 10 points each, then the game shall be won by the first player subsequently gaining a lead of 2 points. Could you please help the Arif find out who the winner was from the given statistics? (It is guaranteed that statistics represent always a valid, finished match.) Constraints: IsTs 1000 I slength(matchscenario) s 100 Input Format: The first line of the input contains an integer 'T', denoting the number of test cases. The description of 'T' test cases follows. Each test case consist a binary string 'S', which describes a match. "O' means Arif lose a point, whereas '1' means he won the point. . Output Format: Print the output on a separate line a string describing who won the match. If Arif won then print "WIN" (without quotes), otherwise print "LOSS" (without quotes). v logical Test Cases Test Case 1 Test Case 2 INPUT (STDIN) INPUT (STDIN) 4 eie1111111111 eeee eee1111111111 111eeeeeee 111e00eeeeeeee 101101e11eie1e 1e01111111111 111001e11011e1 100011e1001e1 1111001110011 EXPECTED OUTPUT 1000100111011 WIN EXPECTED OUTPUT LOSS LOSS LSS LOSS LOSS WIN LOSS LOSS LOSS

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem Description:
Arif likes to play volley ball. He found some statistics of matches which described who won the points in order.
A game shall be won by the player first scoring 11 points except in the case when both players have 10 points each, then the game shall be won by the first player subsequently gaining a lead of 2 points.
Could you please help the Arif find out who the winner was from the given statistics? (It is guaranteed that statistics represent always a valid, finished match.)
Constraints:
1sts 1000
I length(matchscenario) s 100
Input Format:
The first line of the input contains an integer 'T', denoting the number of test cases. The description of 'T' test cases follows.
Each test case consist a binary string 'S', which describes a match.
'O' means Arif lose a point, whereas '1' means he won the point.
Output Format:
Print the output on a separate line a string describing who won the match.
IF Arif won then print "WIN" (without quotes), otherwise print "LOSS" (without quotes).
v logical Test Cases
Test Case 1
Test Case 2
INPUT (STDIN)
INPUT (STDIN)
4.
6
e001111111111
111000eeeeeeee
0101111111111
11100000e00eee
1011010110101e
1001111111111
11100101101101
1000110100101
1111001110011
1000100111e11
EXPECTED OUTPUT
EXPECTED OUTPUT
WIN
LOSS
LOSS
LOSS
LOS
LSS
WIN
LOSS
LOS
LOS
Transcribed Image Text:Problem Description: Arif likes to play volley ball. He found some statistics of matches which described who won the points in order. A game shall be won by the player first scoring 11 points except in the case when both players have 10 points each, then the game shall be won by the first player subsequently gaining a lead of 2 points. Could you please help the Arif find out who the winner was from the given statistics? (It is guaranteed that statistics represent always a valid, finished match.) Constraints: 1sts 1000 I length(matchscenario) s 100 Input Format: The first line of the input contains an integer 'T', denoting the number of test cases. The description of 'T' test cases follows. Each test case consist a binary string 'S', which describes a match. 'O' means Arif lose a point, whereas '1' means he won the point. Output Format: Print the output on a separate line a string describing who won the match. IF Arif won then print "WIN" (without quotes), otherwise print "LOSS" (without quotes). v logical Test Cases Test Case 1 Test Case 2 INPUT (STDIN) INPUT (STDIN) 4. 6 e001111111111 111000eeeeeeee 0101111111111 11100000e00eee 1011010110101e 1001111111111 11100101101101 1000110100101 1111001110011 1000100111e11 EXPECTED OUTPUT EXPECTED OUTPUT WIN LOSS LOSS LOSS LOS LSS WIN LOSS LOS LOS
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY