hiddenString: takes a 2-dimensional array of char and a String as input parameters and returns a boolean. The method returns true if we can find the input string inside the array by starting at any position of the array and reading in any straight direction (up, down, left, right, or diagonal).
> HW2.hiddenString(new char[][]{{'a', 'b', 'c'},{'r','c','a','d'},{'b','r'}}, "bcc")
true
> HW2.hiddenString(new char[][]{{'a', 'b', 'c'},{'r','c','a','d'},{'b','r'}}, "ace")
false
> HW2.hiddenString(new char[][]{{'a', 'b', 'c'},{'r','c','a','d'},{'b','r'}}, "cad")
true
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/169804.html
標籤:Java相關
上一篇:rocketmq-springboot可以實作同一topic,多個環境隔離使用么?
下一篇:求助大神。
