IBM HackerRank 在线测评真题|General Software OA 算法题汇总与解析– 一亩三分地 – OA 代写 – OA作弊

Test duration: 60 minutes


Question 1

A hackathon has two tracks with fixed team sizes: teamSize_1 for track 1 and teamSize_2 for track 2. There are p total participants.

Determine the minimum number of teams such that:

  • Every participant belongs to exactly one team.
  • Each team has a size of either teamSize_1 or teamSize_2.

If it is not possible to divide all participants under these conditions, return -1.

Example 1

Suppose teamSize_1 = 3, teamSize_2 = 4, and p = 6
Output: 2

Ideally, participants can be divided into two teams of three and no team of four.

Example 2

Suppose teamSize_1 = 3, teamSize_2 = 4, and p = 2
Output: -1

Constraints

  • 1 ≤ teamSize_1 ≤ 10^5
  • 1 ≤ teamSize_2 ≤ 10^5
  • 1 ≤ p ≤ 10^5

Question 2

You are given a list of time intervals. Each interval has a start point and an end point.
Two intervals are considered non-overlapping if one ends before (or exactly when) the other begins.

Find the largest number of non-overlapping intervals you can choose.

Example 1

Input:
l = [3, 4, 5]
r = [5, 9, 8]

Output: 2

Explanation:

An optimal way of selecting intervals:

  • Interval selected (l[i], r[i]) → Interval range
    • 0 → [3, 5]
    • 2 → [5, 8]

Example 2

Input:
l = [3, 5, 7]
r = [4, 6, 8]

Output: 3

Explanation:

An optimal way of selecting intervals:

  • 0 → [3, 4]
  • 1 → [5, 6]
  • 2 → [7, 8]

Constraints

  • 1 ≤ size of l and r ≤ 2 × 10^5
  • 1 ≤ l[i], r[i] ≤ 10^9
  • `l[i] < r[i]

我们长期稳定承接各大科技公司如Capital One、TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *