cs: add «1400. Construct K Palindrome Strings»
Count directly elements matching the parity check, do not prefilter and count what's been included. URL: https://leetcode.com/problems/construct-k-palindrome-strings/ Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
907856146c
commit
80974c503d
1 changed files with 1 additions and 1 deletions
|
@ -11,6 +11,6 @@ public class Solution {
|
|||
parities[c - 'a'] ^= 1;
|
||||
}
|
||||
|
||||
return parities.Where(p => p != 0).Count() <= k;
|
||||
return parities.Count(p => p != 0) <= k;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue