You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
===============================> Character Battle <=====================================================
4
+
5
+
Given two strings representing your army and an opposing army, each character from your army battles the character at the same position from the opposing army using the following rules:
6
+
7
+
Characters a-z have a strength of 1-26, respectively.
8
+
Characters A-Z have a strength of 27-52, respectively.
9
+
Digits 0-9 have a strength of their face value.
10
+
All other characters have a value of zero.
11
+
Each character can only fight one battle.
12
+
For each battle, the stronger character wins. The army with more victories, wins the war. Return the following values:
13
+
14
+
"Opponent retreated" if your army has more characters than the opposing army.
15
+
"We retreated" if the opposing army has more characters than yours.
16
+
"We won" if your army won more battles.
17
+
"We lost" if the opposing army won more battles.
18
+
"It was a tie" if both armies won the same number of battles.
0 commit comments