11 Jan 2025 |
brian_e | the first thing that came to mind was the strength of steel, with the downside of rust | 22:51:27 |
maya_maya_maya | Download image.png | 22:51:59 |
maya_maya_maya | the name "rust" came from the fungus | 22:52:08 |
maya_maya_maya | tho it became... a crab... | 22:52:17 |
| brian_e | 22:52:49 |
| maya_maya_maya changed their display name from Maya (k is not a lisp ;-;) to maya_maya_maya. | 22:53:03 |
janmakoso | As I said | 23:00:26 |
maya_maya_maya | almost 24 hours apart lol | 23:04:28 |
| miku.rb | 23:53:08 |
12 Jan 2025 |
| jacob.abc | 14:09:49 |
13 Jan 2025 |
| gamingking2436 | 05:43:13 |
| bjorkdi5cord joined the room. | 14:13:42 |
bjorkdi5cord | This might be a better place. Have any of you read this? https://web.engr.oregonstate.edu/~budd/Books/aplc/ | 14:13:43 |
| bjorkdi5cord changed their display name from bjorkdi5cord#0 to bjorkdi5cord. | 14:13:44 |
| shad.ow | 19:06:19 |
| @ricardin25:matrix.org joined the room. | 19:25:17 |
14 Jan 2025 |
.casenc | They're both nlogn :3 | 21:01:48 |
vendethiel | ≡○∧ :P | 21:02:43 |
.casenc | ≍ ∩⍆ :3 | 21:11:39 |
.casenc | * ≍∩⍆ :3 | 21:11:49 |
polylokh_39446 | A1 ← ≡○∧
A2 ← {s𝕊t:
c←•HashMap˜⟨⟩
{𝕩 c.Set 1 + 0 c.Get 𝕩}¨ s
{𝕩 c.Set ¯1 + 0 c.Get 𝕩}¨ t
∧´0=c.Values@
}
A2's about 13x slower than A1 | 21:12:03 |
rubenverg | ≡⍥⊴ (: | 21:12:09 |
dzaima | (bridge had dropped:) jar: To write is_anagram(s,t) , in other languages I'd make a hashmap and count characters. Is arraylangs, would you just write sort(s) == sort(t) ? | 21:12:17 |
rubenverg | also tbh using a hashmap to check anagrams is crazy in pretty much any language, i'd've never even had that thought | 21:13:13 |
jam3943598 | In python the right way to do it is from collections import Counter; Counter(s) == Counter(t) which is a hashmap | 21:14:07 |
dzaima | another option is indices-inverse:
)t:1s a≡○∧b
118us
)t:1s a ≡○(∧-⟜@) b
1.39us
)t:1s a ≡○(/⁼-⟜@) b
960.47ns though that requires having the elements be (convertable to) integers of some non-massive range. (also CBQN has slow character sorting ¯\_(ツ)_/¯) | 21:18:17 |
dzaima | * another option is indices-inverse:
)r a‿b←('a'+1000•rand.Range 26){𝕩⋄•rand.Deal∘≠⊸⊏𝕗}¨ ↕2
)t:1s a ≡○∧ b
118us
)t:1s a ≡○(∧-⟜@) b
1.39us
)t:1s a ≡○(/⁼-⟜@) b
960.47ns though that requires having the elements be (convertable to) integers of some non-massive range. (also CBQN has slow character sorting ¯\_(ツ)_/¯) | 21:18:43 |
polylokh_39446 | oh yeah, the performance gap between A1 and A2 gets much smaller with 1000-character strings | 21:20:19 |
panadestein | In reply to @_discord_1162491071339712644:t2bot.io oh yeah, the performance gap between A1 and A2 gets much smaller with 1000-character strings Yeah 13x linear vs nlogn cannot be :) | 21:20:55 |
dzaima | some more detailed timings | 21:28:06 |