Algorithm
problem Link : https://www.codechef.com/START94D/problems/CS2023_STK
Problem
CodeChef offers a feature called streak count. A streak is maintained if you solve at least one problem daily.
Om and Addy actively maintain their streaks on CodeChef. Over a span of consecutive days, you have observed the count of problems solved by each of them.
Your task is to determine the maximum streak achieved by Om and Addy and find who had the longer maximum streak.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of multiple lines of input.
- The first line of each test case contains an integer — the number of days.
- The second line of each test case contains space-separated integers, the of which is , representing the problems solved by Om on the day.
- The third line of each test case contains space-separated integers, the of which is , representing the problems solved by Addy on the day.
Output Format
For each test case, output:
OM
, if Om has longer maximum streak than Addy;ADDY
, if Addy has longer maximum streak than Om;DRAW
, if both have equal maximum streak.
You may print each character in uppercase or lowercase. For example, OM
, om
, Om
, and oM
, are all considered the same.
Constraints
- The sum of over all test cases won't exceed .
Sample 1:
3 6 1 7 3 0 2 13 0 2 3 4 5 0 3 1 3 4 3 1 2 5 1 2 3 0 1 1 2 0 2 3
Addy Draw Om
Explanation:
Test case : Om has a maximum streak of days, while Addy has a maximum streak of days.
Test case : Both have the same maximum streak of days.
Test case : Addy has a maximum streak of days and Om has a maximum streak of days.
Code Examples
AdvertisementsDemonstration
CodeChef solution CS2023_STK - CodeChef Streak Codechef solution in C,C++