1p3a
Question
·
Apr 2026
Rubrik OA Question: Minimum Swaps to Make Binary String Palindrome
Question Details
Hi everyone, I recently got this question in an OA (Rubrik): Given a binary string s consisting of only '0' and '1', find the minimum number of swaps (swap any two characters, not necessarily adjacent
Full Details
Hi everyone, I recently got this question in an OA (Rubrik): Given a binary string s consisting of only '0' and '1', find the minimum number of swaps (swap any two characters, not necessarily adjacent) required to make the string a palindrome. If it is impossible, return -1. Example: Input: s = "101000" Output: 1 (swap the chars at position '2' & position '5') Can anyone please share the exact question link for practice if they have it handy? or best - if you have solution, please post this question to leetcode.
Free preview. Unlock all questions →
Topics
Strings
More from Rubrik
Reddit
Rubrik System Coding Interview Experience?
1p3a
Rubrik 2026 Summer Intern Online Assessment for SDE Frontend
Reddit
Rubrik SDE Interview – No update
1p3a
Rubrik Internship Online Test: Subarray XOR, Team Cost, and Scheduling Problems
1p3a
Rubrik New Grad 2025 Software Engineer Interview Experience