加载中...
public class Solution { public boolean hasPath(char[] matrix, int rows, int cols, char[] str) { } }
class Solution { public: bool hasPath(char* matrix, int rows, int cols, char* str) { } };
# -*- coding:utf-8 -*- class Solution: def hasPath(self, matrix, rows, cols, path): # write code here
class Solution { public bool hasPath(string matrix, int rows, int cols, string path) { // write code here } }
function hasPath(matrix, rows, cols, path) { // write code here } module.exports = { hasPath : hasPath };
package main /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ func hasPath( matrix string , rows int , cols int , path string ) bool { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # @param matrix string字符串 # @param rows int整型 # @param cols int整型 # @param path string字符串 # @return bool布尔型 # class Solution def hasPath(matrix, rows, cols, path) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ def hasPath(matrix: String,rows: Int,cols: Int,path: String): Boolean = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ fun hasPath(matrix: String,rows: Int,cols: Int,path: String): Boolean { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ public boolean hasPath (String matrix, int rows, int cols, String path) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ export function hasPath(matrix: string, rows: number, cols: number, path: string): boolean { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ func hasPath ( _ matrix: String, _ rows: Int, _ cols: Int, _ path: String) -> Bool { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * @param matrix string字符串 * @param rows int整型 * @param cols int整型 * @param path string字符串 * @return bool布尔型 */ pub fn hasPath(&self, matrix: String, rows: i32, cols: i32, path: String) -> bool { // write code here } }
"ABCESFCSADEE",3,4,"ABCCED"
true
"ABCESFCSADEE",3,4,"ABCB"
false