注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Roblox 24 NG codesignal OA
求大米 谢谢
一共两题 我发第一道题
第二题给大米的私信我 我私发
谢谢.
. Waral dи,You are given a rectangular matrix of integers board and a square matrix of characters pattern. The elements of board are digits (integers between o and 9 ). The characters of pattern are either digits or lowercase English letters.Your task is to find a submatrix in board which matches the pattern.A submatrix of integers submatrix matches a matrix of characters pattern if:The matrices have identical dimensions.lf any character of pattern is a digit, then the corresponding integer of submatrix in the same position should be equal to that digit.lf any character of pattern is a letter, then all the occurrences of that letter in pattern should correspond to the same digit in submatrix any two distinct letters of pattern , their corresponding digits should be different.lf there is a submatrix of board which matches the pattern , return an array of two integers representing the row and the column numbers (0-indexed) of the upper-left corner of the submatrix. lf there are more than one such submatrix, return the coordinates of the submatrix with the lowest row index, and in case there is still a tie, return the coordinates of the submatrix with the lowest column index. lf there are no suitable answers, return [-1,-1]
Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than o(board, length * board[0].length * pattern.length2) will fit within the execution time limit. Waral dи,
. Χ
Input/Output
A rectangular matrix consisting of digits from 0 to 9
Guaranteed constraints:
1 <= board.length <= 50 ..
1 <= board[i].length <= 50.
[input] array.array.char pattern
A square matrix of characters, where each character is either a digit or lowercase English letter.
Guaranteed constraints: ..
1 <= pattern.length <= min (board.length, board[0].length)
pattern[i].length = pattern,length
[output] array.integer
An array of integers representing the coordinates of the upper-left corner of the submatrix matching pattern, or[-1, -1] if there is no such submatrix.
补充内容 (2023-08-24 12:05 +08:00):
你们加了米的麻烦留个邮箱。。。我没有发私信那个梨
谢谢
. ----
补充内容 (2023-08-25 02:28 +08:00):
. 1point3acres.com !!!!!!!!!!!!!!!!
加了米的记得自己回复留邮箱!!!!!!!! |