Pocket Book DescriptionOne day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written.As mom wasn…
学习sql中的排列组合,在园子里搜着看,看到篇文章,于是自己(新手)用了最最原始的sql去写出来: --需求----B, C, F, M and S住在一座房子的不同楼层.--B 不住顶层.C 不住底层.--F 既不住顶层也不住底层.M 住得比 C 高.--S 住的楼层和 F 不相邻.--F 住的楼层和 C 不相邻. create table pailie (rnam varchar(20) ) select 'B' as rnam into #y union select 'C' union…
一般用dfs来做 最简单的一种: 17. Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit s…