16 Jan 2025 |
| @brodobree:matrix.org left the room. | 22:32:53 |
18 Jan 2025 |
jam3943598 | How is a two-pointers problem like https://leetcode.com/problems/container-with-most-water/description/ done in arraylang? | 21:45:02 |
janmakoso | I would approach this type of problem with an outer product | 21:47:15 |
janmakoso | You could use scans I believe | 21:47:28 |
miku.rb | i remember seeing a blog post for this exact problem. i think it used a scan | 21:47:35 |
janmakoso | Not sure if it would work 100% without trying it | 21:47:48 |
Marshall | Maybe something like, for each column, find the leftmost taller (or equal) column using a max-scan and binary search. This will always include the maximal container if its shorter side is on the right. Do the same in the other direction and you have the answer. | 22:01:07 |
Marshall | bqn)
{βΒ΄π©Γ(ββ π©)-(β`π©)βπ©-1}{π½βπ½ββ½} 1βΏ8βΏ6βΏ2βΏ5βΏ4βΏ8βΏ3βΏ7 | 22:06:48 |
BQNBot | Marshall 49 | 22:06:49 |
dzaima | (bridge had dropped:) South: i remember seeing a blog post for this exact problem. i think it used a scan janMakoso: Not sure if it would work 100% without trying it South: nevermind, it was for lc 42 polylokh: "Learn K, Idiom by Idiom" starts with this problem, https://nsl.com/k/training/idioms_K3.pdf South: it also was not a blog post, it was on r/apljk https://www.reddit.com/r/apljk/comments/1axf4tk/leetcode_trapping_water_problem/ South: wow, this seems like a great resource janMakoso: Uiua solution with outer product: /β₯βΓ/-Β°βΒ°β‘ββ§. polylokh: yeah, it's a bit similar to aplcart with examples and commentary. https://aplcart.info/ does have some examples now, the 'play' button pulls an example up in tio.run. | 22:10:18 |
Marshall | (The π©-1 is to get Bins to not count equal entries as greater, but it's a little unfortunate because it won't work on floats. Using β½βΈβ and subtracting from β π© , which reduces to {βΒ΄π©Γ(ββΈ-β π©)+(β`π©)β½βΈβπ©} , avoids that problem.) | 22:12:22 |
Marshall | Trapping Rain Water isn't the same as this container thing, but I did a fast segmented version of that a few months back in the BQN channel. | 22:15:35 |
21 Jan 2025 |
| lkuty joined the room. | 17:01:28 |
hd3625 | Guys I'm standing in the shower as we speak | 20:04:32 |
hd3625 | Having a shower thought, what is some good knowledge a array programmer should have? | 20:05:07 |
22 Jan 2025 |
| miku.rb changed their profile picture. | 00:10:12 |
hermetian | Generally more specific questions are more likely to catch peopleβs attention. What have you been using array languages for? | 09:44:39 |
loke | hermetian: as a calculator | 09:47:21 |
hermetian | Heh. This was meant as a response to hd3625βs question. Oh, was this discussed already? | 09:48:37 |
loke | Oh I see | 09:48:58 |
hd3625 | I wanted to try testing out the using for graphics programming | 11:41:55 |
hd3625 | Using OpenGL or whatever libraries are available | 11:42:28 |
hd3625 | I think array programming has uses far outside math in practical applications | 11:43:35 |
hd3625 | Like using the language to calculate everything and doing certain idk how to do in BQN using the C FFI and pass through functions I wouldn't know how to create in the language | 11:44:34 |
brian_e | that's basically what rayed-bqn is for, the graphics lib i'm making in bqn | 11:45:07 |
brian_e | [link](https://github.com/Brian-ED/rayed-bqn) | 11:46:16 |
hd3625 | I see your library and would love to use it when I'm not so fresh π
in the space | 11:46:17 |
brian_e | sure | 11:46:28 |
hd3625 | I don't think I can do something like fizz buzz yet | 11:46:31 |
hd3625 | I'm gonna try today | 11:46:59 |