Home > Back-end >  Of new, code, don't use break and continue
Of new, code, don't use break and continue

Time:10-13

HiddenString: takes a two - 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 The 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
  • Related