華為OD機(jī)試-- 查字典

輸入一個(gè)單詞前綴和一個(gè)字典,輸出包含該前綴的單詞
輸入描述:
單詞前綴+字典長(zhǎng)度+字典字典是一個(gè)有序單詞數(shù)組
輸入輸出都是小寫
輸出描述:
所有包含該前綴的單詞,多個(gè)單詞換行輸出若沒(méi)有則返回-1
示例1
輸入:
b 3 a b c
輸出:
b
示例2
輸入:
abc 4 a ab abc abcd
輸出:
abc
abcd
示例3
輸入:
a 3 b c d
輸出:
-1
Java 實(shí)現(xiàn):https://renjie.blog.csdn.net/article/details/130856848
Python實(shí)現(xiàn):https://renjie.blog.csdn.net/article/details/130856833
C++ 實(shí)現(xiàn):https://renjie.blog.csdn.net/article/details/130856824
JavaScript實(shí)現(xiàn):https://renjie.blog.csdn.net/article/details/130856808
C實(shí)現(xiàn):https://renjie.blog.csdn.net/article/details/130856800
標(biāo)簽:華為OD華為od機(jī)試