Kroppeb
• Member for 3 years, 6 months
• Last seen more than a month ago

Brachylog, 4 bytes It's always nice to see a challenge and know brachylog is gonna beat everyone. Takes current classes as input and new classrooms as output; It will output true if it finds a way to ...

Brachylog, 22 16 bytes {Ṣ∧Ị∋|}ᵐ²ịᵐ.k+~t Try it online! -6 bytes thanks to @Fatelize Explanation {Ṣ∧Ị∋|}ᵐ²ịᵐ.k+~t { }ᵐ² # for each letter in each string Ṣ∧Ị∋ ...

Brachylog, 28 24 23 bytes This feels quite long but here it is anyway -4 bytes thanks to DLosc by compressing the optional flips -1 bytes thanks to DLosc again by doing the partial sums in 1 go {|↔}...

Brachylog, 7 6 bytes By making a range and multiplying it -1 byte tanks to ovs having the idea to use the max() function ;1⌉⟦₁× Explanation ;1 -- If n<1, use n=1 instead (zero case) ...

Brachylog, 24 22 bytes {~{ℕ≤.&≜↔;?+}{|↰₁}|}ᶠ⌋ 2 bytes thanks to sundar noticing that I had a {{ and }} Explanation -- f(n): -- g(x): { -- ...

Jelly, 4 bytes My first Jelly program RÆNS Try it online!

Python3, 105 103 bytes This is my first golf here so be kind =) -2 bytes tanks to Chas Brown lambda d,b,x,y,z:sum((x+y in i)-2*((z*b+x+y+z)[:3]in i)-(y+x in i)+2*((z*b+y+x+z)[:3]in i)for i in d)>0 ...

Brachylog, 9 bytes {ȧdṫo₁}ᵒ¹ Note: due to how ordering works in brachylog, it does not work on number correctly. This is fixed by casting the number to a string (ṫ) at the cost of 1 byte. Try it ...

Brachylog, 28 bytes Ẹ|~c["(",A,")(",B,")"]∧A;B↰ᵐ Try it online! Explanation -- The string perfectly balanced iff Ẹ -- ...

Brachylog, 9 bytes Beating @sundar by using half as much bytes {~l~ḋ}ᶠ⁽t Explanation -- Input like [n,k] { }ᶠ⁽ -- Find the first n values which ~ḋ ...

Brachylog, 8 bytes ;.c~^₂∧ℕ Sadly enough it takes 3 bytes to check if a number is square and an extra ℕ is needed if the input is a square itself. Explanation ;.c~^₂∧ℕ # Find a value ;.c ...

Brachylog, 23 bytes ẹ{bkK&⟨h{≥₁+tg}t⟩,K↰|Ȯ} Try it online! This is a 1 byte save over Fatalize's solution. This uses a recursive approach instead of a iterative Explanation ẹ ...

Brachylog, 42 bytes ,0{hẸ&t|∋₁B∋IhJ&tJ&hhC∧I∋₁C∧It∋S&hb;B,S↰}ᵘ input as [string, nfa] where nfa is a list of state transitions [ initial state, letter, new states as list ] ...

Brachylog, 14 bytes "(<>.<>)"aᶠckb Try it online! "(<>.<>)" # string aᶠ # get all Affixes (pre- and suffixes) c # ...

Brachylog, 14 11 bytes ;0{<≜.↔¬}ⁱ⁽ -3 bytes tanks to Fatalize Explanation ; { }ⁱ⁽ -- Find the nth number 0 -- (starting with 0) < -- ...

Brachylog, 23 bytes {ḍ\⟨+ᵐ↰₁ᵐ-ᵐ⟩c/₂ᵐ|}ᵐ\↰₁ᵐ Input: A list of columns Output: A list of rows How: It uses the Fast Hadamard Transformation. AFAIK Brachylog doesn't have matrix multiplication, nor ...

Brachylog, 10 bytes It's always nice to see problem where Brachylog performs best ⊆Is₃ᶠ≠ᵐ∧Il Explanation ⊆I # Find the minimal ordered superset of the input (and store in I) where: s₃...

Python 3, 80 78 bytes I don't realy do many python code golfs but I thought I could give it a try -2 bytes: realised not(any()) is the same as all(not()) and could move the not into the r-string ...

Brachylog, 9 bytes Different approach then DLosc's answer Ċ-14&∋ṗ&× Takes N as output, gives [P, P-14] or [P+14,P] back through input (biggest number first) explanation Ċ # ...

Brachylog, 90 bytes ;Ṡ{hhH↰₂gB&hb~c[A,B,C]&tT;C↔↰U∧" under ",H,T;A↔↰,U|tT&hh,TgJ&hb;T↰Q∧J,Q|h} ~↰₃|↰₃ ∧"un";?c I made this while being under the impression that this could be ...

Brachylog, 35 32 bytes l⟧₅;?z{tℕ₁I&h;10↔^;I×ṫ}ˢ;"+"zckc -3 bytes cause 0 isn't a valid input Try it online! or testsuite Explanation # implicit ...

Brachylog, 12 8 bytes f^₂ᵐ+~^₂ -4 bytes thanks to Fatelize cause i didn't realize brachylog has a factors functions explanation f^₂ᵐ+~^₂ # full code f # get ...

Brachylog, 13 bytes orignally based of @sundar's design ⟨≡⟨t-h⟩ᵐ²\⟩c+ Explanation ⟨≡ \⟩ # Take the original matrix and it's transpose ᵐ # and execute the ...

Brachylog, 34 32 bytes ~b≜ḅ⟨h⟨h≡^⟩l⟩ᵐs₂ᶠ{zh>₁&ttṅ|tt}ᵐ+ Try it online!

Brachylog, 12 bytes {≤.;?%0∧}ᵐ<₁ Weird enough trying to multiply each variable by a number will start at trying to multiply by 2 and not 0 or 1. This seems to work though and beats both other ...

Brachylog, 65 40 33 bytes This breaks down for N bigger then 9. So I'm happy N can be only go to 8 =) ⟦₅⟨∋≡∋⟩ᶠ;?z{{hQ&t⟦₅↰₁;Qz-ᵐ×ȧ2}ᶜ}ᵐ -25 bytes by switching to KSab's formula -7 bytes by ...

Brachylog, 23 22 bytes +ᵐ-₁ᵐḍ₅+ᵐJo⊇~⟦₁3∧J+|∧0 +3 bytes but prints out 0 instead of false if no 4,5,6 (Fatalize) -2 4 bytes (sundar) One of my first branchylog programs. Can probably be golfed more. ...

B is for Brachylog, 2 bytes → Score: 11 Ạẉ Try it online!