AnalystPath

Can Three Beams Form a Bracket

PandasEasyJunior level~10 min

Problem

A `BeamSet` DataFrame lists candidate brackets as three beam lengths `side_a`, `side_b`, `side_c`. Three beams can be joined into a closed three-sided bracket only when each pair of sides sums to strictly more than the remaining side (the side-length inequality).

For every row, add a column `can_form` holding `'Yes'` if the three lengths form a valid bracket and `'No'` otherwise. Return `side_a`, `side_b`, `side_c`, `can_form`.

Input data

Example rows — the live problem includes the full dataset.

beamset
side_aside_bside_c
141631
91214

Expected output

Your answer should return 2 rows with the columns side_a, side_b, side_c, can_form.

Starter code (Pandas (Python))

import pandas as pd

def can_form_bracket(beamset: pd.DataFrame) -> pd.DataFrame:
    # Your code here
    return beamset

Solve this Pandas question free

Write Pandas (Python) and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related Pandas questions