Re: [algogeeks] Need an optimized solution.

2013-10-20 Thread Saurabh Paliwal
I submitted the solution on hackerrank and got Accepted. There is a change though, there may be more terms like Term (r+1) but this can also be done using O(1). Term (r+2) : (2*n+1 - (r+2)*k)/2 and so forth until numerator becomes zero. You can use the same technique to get this sum as well. Sorr

[algogeeks] Word breaking problem

2013-10-20 Thread kumar raja
I came across the word breaking problem in geeks for geeks. http://www.geeksforgeeks.org/dynamic-programming-set-32-word-break-problem/ If the problem statement is to count and print all the possible ways to segment/partitaion a string based on dictionary of words. how to solve this problem? T