Huawei OD high-frequency interview questions

 HUAWEI OD machine test real test catalog: real test catalog

The questions are guaranteed to be real questions that have been tested. Currently, there are six questions. The last four questions are all ancestral questions from Huawei od, and they are often asked.

It is very helpful to practice before the exam, and you can also look at the approximate difficulty

Attachment: Interview Algorithm Questions

1. Most of the interview questions sent by the interviewer are sent in the form of text in the chat of the Tencent meeting

2. The interview algorithm topic, and the final test will be shown to the interviewer. There will be two types:

The first type of acm input, that is, the debugger input, the input method during the machine test, is tested locally;

The second is to directly write the data in the main function, such as line 5 above, which is fine in most cases

1. Decompression of a string compressed representation

There is a simple compression algorithm: for a string consisting of all lowercase English letters, compress the part with more than two consecutive identical letters into the continuous number plus the letter, and keep the other parts unchanged
. Example: The string "aaabbccccd" is compressed into the string "3abb4cd". Please write a decompression function to output the decompressed string according to the input string.

Input description:
Input one line, which is an ASCII string, the length of which will not exceed 100 characters. The use case guarantees that the length of the output string will not exceed 100 characters. Output description: Example 1:

Input
4dff
and
output
ddddff

Ideas:

simple imitation questions

record multiples ans, if ans

Guess you like

Origin blog.csdn.net/m0_58177653/article/details/130958560