FastPrepTV Tower Expansion
Problems/TV Tower Expansion

TV Tower Expansion

Wells Fargo logoWells Fargo● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the city matrix, the daily expansion, and the goal of finishing. It leaves out the neighborhood rule and the rule for an empty source. Our version is about 96% the same as the reported question.

You are given a rectangular binary matrix city. A cell with value 1 initially contains a TV tower, and a cell with value 0 does not.

Each day, every cell containing a tower installs towers in its orthogonally adjacent cells: up, down, left, and right, when those cells are inside the matrix.

Return the number of days required for every cell to contain a tower. If the city has no initial tower, return -1.

Function

daysToCoverCity(city: int[][]) → int

Examples

Example 1

city = [[1,0,0],[0,0,0]]return = 3

The farthest cell is three orthogonal steps from the initial tower.

Example 2

city = [[1,0,1],[0,0,0],[0,1,0]]return = 1

Every empty cell is adjacent to at least one of the three initial towers.

Example 3

city = [[1,1],[1,1]]return = 0

The city is already fully covered.

Example 4

city = [[0,0],[0,0]]return = -1

No initial tower exists, so expansion cannot begin.

Constraints

  • 1 <= city.length <= 500.
  • 1 <= city[i].length <= 500.
  • Every row has the same length.
  • city[i][j] is 0 or 1.

More Wells Fargo Online Assessment questions

  • Server Upgrade PlanningOA · Seen Nov 2026
  • Student and Course EnrollmentOA · Seen Nov 2026
  • Bond Interest Summary Above 3%OA · Seen Oct 2026
  • Count Phrases Formed by Anagram ReplacementOA · Seen Oct 2026
  • Event Statistics AggregatorOA · Seen Sep 2026
  • Ordered Deployment Configuration ValidatorOA · Seen Sep 2026
  • Longest Subsequence That Is a SubstringOA · Seen Jul 2026
  • Overloaded Game Account InventoriesOA · Seen Jul 2026
  • Count Server ReplacementsOA · PHONE SCREEN · Seen Feb 2026
  • Minimum Remaining LengthOA · PHONE SCREEN · Seen Feb 2026

Similar questions at other companies

  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
  • Shortest Atom Action PathOpenAI · OAOpenAI interview questions
  • Minimum Cleaning Robot RunsHSBC · OAHSBC interview questions
  • Count Islands with DFS and BFSVisa · OAVisa interview questions
  • Number of IslandsGoldman Sachs · OA · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Count One Groups by SizeAgoda · OAAgoda interview questions
  • Ascend Vertical Wall (For off-campus 2025 batch hiring :)Uber · OAUber interview questions
  • Grid ExplorationIMC Trading · OAIMC Trading interview questions
  • Maximum Damage PatchGecko Robotics · OA · PHONE SCREEN
  • Nearest Different Maze Exit for a SnakeIntuit · OAIntuit interview questions

Interview reports that mention this question

  • Wells Fargo OA: What It Tests (2026)

Wells Fargo interview experiences

  • Wells Fargo SWE Intern OA and Interview Questions: 18 Experiences
All Wells Fargo interview questionsSee Wells Fargo hiring insights
Saved
class Solution {
    public int daysToCoverCity(int[][] city) {
      // write your code here
    }
}
Checking account…