properties array in ascending order of attack values. In case of a tie, sort by descending order of defense values.maxDefense to 0, which will keep track of the maximum defense value seen so far.weakCharacters to 0, which will count the number of weak characters.properties array from right to left (from strongest to weakest attack):
a. If the current character's defense is less than maxDefense, increment weakCharacters.
b. Update maxDefense if the current character's defense is greater than maxDefense.weakCharacters.