[LeetCode] Encode Number

1256. Encode Number

Given a non-negative integer num, Return its encoding string.

The encoding is done by converting the integer to a string using a secret function that you should deduce from the following table:

Read more
[LeetCode] Smallest Common Region

1257. Smallest Common Region

You are given some lists of regions where the first region of each list includes all other regions in that list.

Naturally, if a region x contains another region y then x is bigger than y. Also, by definition, a region x contains itself.

Given two regions: region1 and region2, return the smallest region that contains both of them.

If you are given regions r1, r2, and r3 such that r1 includes r3, it is guaranteed there is no r2 such that r2 includes r3.

It is guaranteed the smallest region exists.

Read more
[LeetCode] Number of Burgers with No Waste of Ingredients

1276. Number of Burgers with No Waste of Ingredients

Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:

  • Jumbo Burger: 4 tomato slices and 1 cheese slice.
  • Small Burger: 2 Tomato slices and 1 cheese slice.

Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].

Read more
[AtCoder] A - Prefix and SuffixRead more
[AtCoder] C - Boxes and CandiesRead more
[AtCoder] B - Between a and b ...Read more
[AtCoder] A - Shik and StoneRead more
[AtCoder] A - Simple CalculatorRead more
[Codeforces] Round #640 (Div. 4) E. Special ElementsRead more
[Codeforces] Round #640 (Div. 4) F. Binary String ReconstructionRead more