We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c59c8cf commit 4bd6425Copy full SHA for 4bd6425
LeetCode SQL 50 Solution/610. Triangle Judgement/610. Triangle Judgement.py
@@ -0,0 +1,11 @@
1
+import pandas as pd
2
+
3
+def triangle_judgement(triangle: pd.DataFrame) -> pd.DataFrame:
4
+ # Create a new column 'triangle' based on the triangle inequality conditions
5
+ triangle['triangle'] = triangle.apply(
6
+ lambda row: 'Yes' if (row['x'] + row['y'] > row['z'] and
7
+ row['x'] + row['z'] > row['y'] and
8
+ row['y'] + row['z'] > row['x']) else 'No',
9
+ axis=1
10
+ )
11
+ return triangle
0 commit comments