Re: [algogeeks] Re: how to approach this kinda problmls

2012-04-21 Thread amrit harry
@all above you are suggesting brute force solution and have a look at the constraints and time limits which are too strict so such solution would work over here i need a DP approach. @vandana we can't make hash because of the high value of N. @ramindar actually not only reverse there exist all

Re: [algogeeks] Re: how to approach this kinda problmls

2012-04-21 Thread amrit harry
@atul as the problem said i have to find Nth PDS number so N could be 10^9 so 9 digits and pds number can be of 10digits so scanning from 1 to 10^10 in each case (because we can make such a large hash) will cross time limits as there would be 1 test cases so it become 10^14 and which can't

[algogeeks] Re: how to approach this kinda problmls

2012-04-20 Thread Ramindar Singh
Just to add to Vandana certain observations like 1) consider 1,2,3,4. 9 as 01,02,03,04.. 09 so the reverse of the strings are also present in the answer ie 10,20,30,40 90 2) when you traverse the numbers like 11,12,13,14 19 and you dont find any PDS number you are omitting