Tutorial of Character game

Prerequisite : Basic String
Problem statement summary : You are given a string which contains only character p and q. Check whether p > q or q > p or p = q.
Solution : First you need to count the frequency of p and q. if occurrence of p is greater than q then print Roy or vice versa. If equal then print Draw.
Time Complexity : O (|S|)

0 comments

No comments so far...

Information

ID
1040
Difficulty
1
Category
Beginners দেখানোর জন্য ক্লিক করুন
Tags
(None)
# Submissions
60
Accepted
38
Accepted Ratio
63%
Uploaded By