本帖最后由 JudySun233 于 2024-10-13 18:39 编辑
90分钟,不开摄像头,总共三道题,如果有帮助的话求加米,谢谢
岗位:Full Stack Intern FY25 (Summer 2025) Meraki role
网站:SHL。先通过邮件里的Candidate ID, Email ID, Last Name 和 First Name登录。然后选择语言,三道题可以随时切换。function output最后都是print结果
第一道题string,比我想象中难很多,testcase特别多,最后8/10. 欢迎大家和我讨论哪些corner case我没考虑到(顺便问问大家怎么添加图片,我添加后,好像帖子里显示不出来)
第二道题简单dp(大概10分钟)
第三道题最简单,两个for循环结束(大概2分钟)
第一题
几种情况:1 letter直接append到output string 2 如果是-,考虑后面是不是数字,如果是数字,看数字后面是否还是数字,比如-10,只重复一遍 3 考虑是否是数字,考虑是否是0或者1。如果string只有正负数字,返回空。但是还是8/10,求大家分享,我哪些地方没考虑到。这道题花的时间最久
Given a string S, you need to generate an encoded version of this string. The encoding rules are as follows:
1 lf you encounter a letter in the input string, add it to the output.
2 If you encounter a digit 'd', repeat the current output 'd-1' times and append it to the current given rules.
Input
The first line consists of an integer.numRow, representing the number of rows in the pattern (L). The next line consists of an integernumColumn, representing the number of columns in the pattern(C).
Output
Print L lines consisting of C characters to form a chessboard. like pattern.
Example
Input:
4
Output:
#$#
$#$
#$#
$#$
Explanation:
There are 4 lines. The first character of the first line is '#' and the rest of the output alternates between $and #.
希望对大家有帮助,求加米求加米,求加米,谢谢!祝大家找工一切顺利 |