⌘K
Flycodx

Freelancer Budget Pair Matching System

Freelancer Budget Pair Matching System

MediumArrays100% accepted

Arjun is a project manager at a Mumbai agency with fixed budget to hire exactly two freelancers. He has hourly rates of available talent and needs to know how many valid pairs fit within budget. Rule: count unordered pairs (i<j) with rates[i]+rates[j] <= budget. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.

Approach

Given an array of freelancer hourly rates and total budget, count how many pairs of freelancers can be hired without exceeding the budget.

Input

rates=[10,20,30,40] budget=50

Output

4
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3