Solve the following algorithmic problems:
-
Egg testing with limited resources: You are given k identical eggs and a building with n floors. An egg breaks if it is dropped from a floor higher than some unknown critical floor F, and it survives otherwise. Determine the minimum number of drops needed in the worst case to identify F.
-
Find zero-sum triplets: Given an integer array nums, return all unique triplets [a, b, c] such that a + b + c = 0. The same triplet may not appear more than once in the output.
-
Recolor a grid into a Y shape: You are given an odd integer n and an n x n grid whose cells contain only 0, 1, or 2. The Y-shape consists of the two diagonals from the top corners to the center cell, plus the center column from the center cell down to the last row. In one operation, you may change any cell to 0, 1, or 2. Find the minimum number of changes required so that all Y-shape cells have one common value, all non-Y cells have another common value, and the two values are different.