Difference between revisions of "User:Vishwa"

From ZCubes Wiki
Jump to navigation Jump to search
Line 2: Line 2:
  
  
LEETCODE 1109:
+
== My LeetCode Solutions ==
 +
 
 +
=== LeetCode 1109 ===
 +
<pre>
 
bookings = [[1,2,10],[2,3,20],[2,5,25]],  
 
bookings = [[1,2,10],[2,3,20],[2,5,25]],  
 
n = 5;
 
n = 5;
Line 12: Line 15:
 
KEYTAGS(ro).map(r=>[r[0],SUM(r[1])])
 
KEYTAGS(ro).map(r=>[r[0],SUM(r[1])])
 
PRINT(ro)
 
PRINT(ro)
 +
</pre>
  
LEETCODE 2491:
+
=== LeetCode 2491 ===
 +
<pre>
 
skill = [3,4];
 
skill = [3,4];
 
p = skill.⋰.⁜(2);
 
p = skill.⋰.⁜(2);
Line 28: Line 33:
  
 
PRINT(result);
 
PRINT(result);
 +
</pre>

Revision as of 13:02, 3 June 2025

Leetcode Solutions and Render3D/RENDER examples.


My LeetCode Solutions

LeetCode 1109

bookings = [[1,2,10],[2,3,20],[2,5,25]], 
n = 5;
ro={};
f=(x,y)=>ro[x]=(ro[x]||0) + y;
f#;
bookings.map(r=>f((r[0])..(r[1]),r[2]));
ro
KEYTAGS(ro).map(r=>[r[0],SUM(r[1])])
PRINT(ro)

LeetCode 2491

skill = [3,4];
p = skill.⋰.⁜(2);
arr = p[0].mergerows(p[1].reverse());
tar = ∑(arr[0]);

if(arr.filter(r => ≠(∑(r), tar)).length > 0)
{
    result = "Not compatible(-1)";
}
else{
    result = ∑(arr.$$(✖))
}

PRINT(result);