Company: Rapidue_Technology_25nov
Difficulty: medium
Problem Description In the quirky city of Logictown, numbers live together in a long queue called nums. Normally, everyone minds their own business — but lately, the Mayor has gone a bit bitwise crazy! He wants every number in Logictown to become exactly the same, so that there's no more "value discrimination." To make this happen, the Mayor allows a strange ritual called the AND Meltdown: - You can pick any continuous group of numbers (a subarray). - All numbers in that group melt together into one value — the bitwise AND of every number in that subarray. - After the meltdown, everyone in that group has the same new value. Your mission as the town engineer: Figure out the minimum number of meltdowns (operations) needed until every number in nums becomes equal. Operation Rule In one operation: Choose any subarray nums[l...r] Replace each element in that subarray with (nums[l] AND nums[l+1] AND ... AND nums[r]) Goal Make all elements in nums identical using the fewest operations. Return