Honestly's blog

By Honestly, history, 10 months ago, In English

While solving dp ,i think we have all solved the problem subset sum==target ,its pretty basic ,now what if there were q queries for different target sums,obviously the brute force wud be to reconfigure the dp array before each query ,but the whole process would then take O(N*Q*T) time ,which has a high chance of giving TLE, can you guys suggest ways to initialize the dp array only once ,and keep it constant across all queries ?

Full text and comments »

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

By Honestly, history, 10 months ago, In English

Hello ,this is my submission for problem 1926D - Vlad and Division:325526745 its showing accepted when i use a map ,but when i was previously using unordered_map ,it was giving TLE ,can anyone explain me why ?

Full text and comments »

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

By Honestly, history, 10 months ago, In English

As the title suggests i used the codefoces api and did some python coding to find the average and median ratings for Div 2,A,B,C problems ,which i believe will help in newbies like me to grow.

Here are the results:

 -This shows the spread of the problem ratings .

 -This shows boxplot

Full text and comments »

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

By Honestly, history, 10 months ago, In English

You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [xi, yi] such that xi < xj for all 1 <= i < j <= points.length. You are also given an integer k.

Return the maximum value of the equation yi + yj + |xi — xj| where |xi — xj| <= k and 1 <= i < j <= points.length.

It is guaranteed that there exists at least one pair of points that satisfy the constraint |xi — xj| <= k.

This is the Leetcode problem 1499 ,does anyone have any idea on how to solve this?.i have been scratching my head about this for the last few minutes ,

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it