deepak1527's blog

By deepak1527, history, 6 years ago, In English

How to solve the following problem. Find the sum of the number of distinct characters in all the distinct substrings of S. 1<=|S|<=100000. S="aabb"
Set of distinct sub-strings of "aabb" = {a,b,aa,ab,bb,aab,abb,aabb} sum = 1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 = 12.

Thanks!

Full text and comments »

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

By deepak1527, history, 7 years ago, In English

given a matrix of N rows and M columns, each element of matrix is equal to 0 or 1 . we can swap any two rows of matrix any number of times. we are required to find the maximum area of a submatrix consisting of 1's only by swapping rows. constraints (1<=n,m<=5000) problem link: https://www.hackerearth.com/challenge/college/execute-final-round/algorithm/47da7e50ba054fdcb66c292b7f681fb5/ please help and thanks in advance.

Full text and comments »

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