[LeetCode] Find the Minimum Possible Sum of a Beautiful Array

2834. Find the Minimum Possible Sum of a Beautiful Array

You are given positive integers n and target.

An array nums is beautiful if it meets the following conditions:

  • nums.length == n.
  • nums consists of pairwise distinct positive integers.
  • There doesn’t exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.

Return the minimum possible sum that a beautiful array could have.

Read more
[LeetCode] Furthest Point From Origin

2833. Furthest Point From Origin

You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.

In the ith move, you can choose one of the following directions:

  • move to the left if moves[i] = 'L' or moves[i] = '_'
  • move to the right if moves[i] = 'R' or moves[i] = '_'

Return the distance from the origin of the furthest point you can get to after n moves.

Read more
[Codeforces] Round 279 (Div. 2) D. ChocolateRead more
[Codeforces] Round 283 (Div. 2) D. Tennis GameRead more
[Codeforces] Good Bye 2014 D. New Year Santa NetworkRead more
[Codeforces] Round 286 (Div. 2) C. Mr. Kitayuta, the Treasure HunterRead more
[Hacker Earth] String TransformationRead more
[Hacker Earth] Tax CollectionRead more
[Hacker Earth] Minimum Adjacent DifferenceRead more
[Hacker Earth] Rohit and his brotherRead more