[LeetCode] Minimum Time Visiting All Points

1266. Minimum Time Visiting All Points

On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points.

You can move according to these rules:

  • In 1 second, you can either:

    • move vertically by one unit,

      • move horizontally by one unit, or

      • move diagonally sqrt(2) units (in other words, move one unit vertically then one unit horizontally in 1 second).

  • You have to visit the points in the same order as they appear in the array.

  • You are allowed to pass through points that appear later in the order, but these do not count as visits.

Read more
[LeetCode] Find Words That Can Be Formed by Characters

1160. Find Words That Can Be Formed by Characters

You are given an array of strings words and a string chars.

A string is good if it can be formed by characters from chars (each character can only be used once).

Return the sum of lengths of all good strings in words.

Read more
[Hacker Earth] MatrixRead more
[Hacker Earth] Selection of NumbersRead more
[Hacker Earth] Array Splitting into two parts <P2SME>Read more
[Hacker Earth] Fredo and Two StringsRead more
[Hacker Earth] Binary Modulo <P2SME>Read more
[Codeforces] Round 912 (Div. 2) E. Geo GameRead more
[Codeforces] Round 235 (Div. 2) D. Roman and NumbersRead more
[Codeforces] Coder-Strike 2014 - Round 1 D. Giving AwardsRead more