Python
How many connected regions are in the matrix (Number of Connected Regions)? Condition Given a 2D matrix of integers. Each cell contains a number. Two cells are considered connected if they are adjacent horizontally or vertically and contain the same number. A connected region is a maximum group of cells with the same value, connected to each other. Write a function that returns the number of such connected regions in the matrix. Input data A 2D array of integers grid (matrix size m×n). Output data An integer — the number of connected regions. Constraints 1 <= m, n <= 100 Code template: # Available without import: json, sys, io def count_regions(grid): # TODO: implement the solution here return 0
When is a linked list better than a regular list?
How do you check if a specific port is open on a remote server from a Linux workstation?
Are there any questions about the interview stages?
Have you ever written tests?
What databases have you had to work with as a developer?
What is the complexity of removing an element from a list by index?
Do you have knowledge of how processes are created and interact in Linux?
How do you navigate and work in Unix systems: how to connect and perform basic diagnostics?
After launching the fee, the money is deducted from users, but the manager does not see the company's income. Where could the money be and how to diagnose it?
How many threads can execute bytecode in Python simultaneously?
How to change the data model to unambiguously combine four transactions of one transfer and then perform a refund with one action?
Do you have documents of military registration and higher education on hand?
What approaches do you use for competitive and parallel task execution in Python, including the impact of GIL?
Show the top 5 users by the number of transactions they have made.
How to solve the problem of finding duplicate strings without using Counter?
Implement pseudocode for fee collection in the existing method `User.transfer`: what entries and checks are necessary?
Can you handle writing a raw SQL query?
Why are you interested in backend development and why did you choose this direction?
Have you ever written programs for processing network traffic?