代码改变世界

阅读排行榜

Check whether string is interleaved

2010-10-01 09:59 by wansishuang, 158 阅读, 收藏,
摘要: Three strings say A,B,C are given to you. Check whether 3rd string is interleaved from string A and B. Ex: A="abcd" B="xyz" C="axybczd". answer is yes.如果元素不相同的话,可以类似归并排序在0(N)时间内解决。如果不想同的话,可以递归的解决f(a, ... 阅读全文

Represent all the dates with tow cubes

2010-09-26 19:44 by wansishuang, 128 阅读, 收藏,
摘要: Given two cubes, how will you represent all the dates in a month by using numbers 0 to 9? You can exchange the cubes and rotate them as you wish!!!1: 01 2 3 4 5 2: 0 1 26 7 8 阅读全文