Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3644. Maximum K to Sort a Permutation
Find the largest non-negative integer k such that the permutation nums can be sorted by swapping only pairs of elements whose bitwise AND equals k. Equivalently, determine the maximum k for which the graph with vertices as positions (or values) and edges between entries with nums[i] & nums[j] == k has connected components that each contain the target values needed to place every element in sorted order.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.