problem0130

package
v0.0.0-...-a601ee6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: MIT Imports: 0 Imported by: 0

README

130. Surrounded Regions

题目

Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.

A region is captured by flipping all 'O's into 'X's in that surrounded region. For example,

X X X X
X O O X
X X O X
X O X X

After running your function, the board should be:

X X X X
X X X X
X X X X
X O X X

解题思路

见程序注释

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UF

type UF struct {
	// contains filtered or unexported fields
}

func NewUF

func NewUF(n int) *UF

func (*UF) Find

func (u *UF) Find(i int) int

func (*UF) IsConnect

func (u *UF) IsConnect(x, y int) bool

func (*UF) Union

func (u *UF) Union(x, y int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL