vd__coder's blog

By vd__coder, history, 22 months ago, In English

I was solving a problem and it led to a sub problem which goes like:

given 10^9>=A,B>0, minimise: 2*x+B%(A+x) , x>=0

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By vd__coder, history, 2 years ago, In English

Consider a matrix of size n, consisting of lower case aplhabets. We are required to find lexicographically smallest string starting from (1,1) and ending at (n,n).From any cell (i,j) we can either go right or down.

Now it is easily solvable in O(n^3) time ans space , but it is required to solve it in O(n^2) both time and space. Any help is appreciated

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it