由买买提看人间百态

topics

全部话题 - 话题: astatus
(共0页)
o******3
发帖数: 91
1
来自主题: JobHunting版 - 面试F家让先做programming puzzle
决定把题目跟我写的很挫的代码贴上来,有需要的同学可以来看。。。
代码可以过sample test
但是目前还不能过所有的Test
题目:
There are K pegs. Each peg can hold discs in decreasing order of radius when
looked from bottom to top of the peg. There are N discs which have radius 1
to N; Given the initial configuration of the pegs and the final
configuration of the pegs, output the moves required to transform from the
initial to final configuration. You are required to do the transformations
in minimal number of moves.
A move consists of picking the topm... 阅读全帖
o******3
发帖数: 91
2
来自主题: JobHunting版 - 面试F家让先做programming puzzle
决定把题目跟我写的很挫的代码贴上来,有需要的同学可以来看。。。
代码可以过sample test
但是目前还不能过所有的Test
题目:
There are K pegs. Each peg can hold discs in decreasing order of radius when
looked from bottom to top of the peg. There are N discs which have radius 1
to N; Given the initial configuration of the pegs and the final
configuration of the pegs, output the moves required to transform from the
initial to final configuration. You are required to do the transformations
in minimal number of moves.
A move consists of picking the topm... 阅读全帖
n********6
发帖数: 1511
3
来自主题: Database版 - 问题:行换列, pivot table
Background:
Collected phone number from 10 sources for each household. Past validation
indicates phone number may have one of 20 status (1, valid, 2, fax, 3, busy,
4, person died, 5, ill, 6, in jail, ... 20)
Question:
Any way to do one query without using cursor go through whole table? (no
concern on performance issue)
Old Table:
HouseID (PK)
APhoneNumber
AStatus
BPhoneNumber
BStatus
...
GPhoneNumber
GStatus
B*****g
发帖数: 34098
4
来自主题: Database版 - 问题:行换列, pivot table
SELECT HouseID, APhoneNumber, AStatus, 'A' PhoneColumns
UNION ALL
SELECT HouseID, BPhoneNumber, BStatus, 'B'
UNION ALL
....
PhoneColumns may be used for remove duplicate

busy,
(共0页)