๐ฎ The Number of Weak Characters in the Game
Welcome to an epic RPG battle arena! You're analyzing character statistics to determine which heroes need power-ups.
You have a collection of game characters, each with two crucial combat stats: attack and defense. Your mission is to identify how many characters are considered weak in the current meta.
A character is weak if there exists at least one other character who completely dominates them - meaning that other character has both higher attack and higher defense values.
Input: A 2D array properties where properties[i] = [attack_i, defense_i] represents the combat stats of the i-th character.
Output: Return the total count of weak characters who are completely outclassed by at least one other character.
Example: If Character A has [5, 5] and Character B has [6, 6], then Character A is weak because Character B dominates in both stats.
Input & Output
Constraints
- 2 โค properties.length โค 105
- properties[i].length == 2
- 1 โค attacki, defensei โค 105
- All characters have positive integer stats