1433. Check If a String Can Break Another String
https://leetcode.com/problems/check-if-a-string-can-break-another-string
Description
Given two strings: s1
and s2
with the same size, check if some permutation of string s1
can break some permutation of string s2
or vice-versa. In other words s2
can break s1
or vice-versa.
A string x
can break string y
(both of size n
) if x[i] >= y[i]
(in alphabetical order) for all i
between 0
and n-1
.
Example 1:
Example 2:
Example 3:
Constraints:
s1.length == n
s2.length == n
1 <= n <= 10^5
All strings consist of lowercase English letters.
ac
Previous1432. Max Difference You Can Get From Changing an IntegerNext1434. Number of Ways to Wear Different Hats to Each Other
Last updated
Was this helpful?