text:
Generate basis elements of the Steenrod algebra
The Steenrod algebra is an important algebra that comes up in algebraic topology. The Steenrod algebra is generated by operators called "Steenrod squares," one exists for each positive integer i. There is a basis for the Steenrod algebra consisting of "admissible monomials" in the squaring operations. It is our goal to generate this basis.
A sequence of positive integers is called admissible if each integer is at least twice the next one. So for instance [7,2,1] is admissible because \$7 \geq 2*2\$ and \$2 \geq 2*1\$. On the other hand, [3,2] is not admissible because \$3 < 2*2\$. (In topology we would write \$\mathrm{Sq}^7 \mathrm{Sq}^2\mathrm{Sq}^1\$ for the sequence [7,2,1]).
The degree of a sequence is the total of it's entries. So for instance, the degree of [7,2,1] is \$7 + 2 + 1 = 10\$. The excess of an admissible sequence is the first element minus the total of the remaining elements, so [7,2,1] has excess \$7 - 2 - 1 = 4\$.
Task
Write a program that takes a pair of positive integers (d,e) and outputs the set of all admissible sequences of degree d and excess less than or equal to e. The output is a set so the order of the admissible sequences doesn't matter.
Examples:
 Input: 3,1
 Output: [[2,1]]

Here we are looking for admissible sequences with total 3. There are two options, [3] and [2,1]. ([1,1,1] and [1,2] have sum 3 but are not admissible). The excess of [3] is 3 and the excess of [2,1] is \$2-1 = 1\$. Thus, the only sequence with excess \$\leq1\$ is [2,1].
Input: 6, 6
Output: [[6], [5, 1], [4, 2]] (or any reordering, e.g., [[5,1],[4,2],[6]])

Since excess is always less than or equal to degree, we have no excess condition. Thus, we're just trying to find all admissible sequences of degree 6. The options are [6], [5, 1], and [4, 2]. (These have excess \$6\$, \$5-1 = 4\$, and \$4-2=2\$.)
Input: 10, 5
Output: [[7,3], [7,2,1], [6,3,1]]

The admissible sequences of degree 10 are:
[[10], [9,1], [8,2], [7,3], [7,2,1], [6,3,1]]

These have excess \$10\$, \$9-1 = 8\$, \$8-2 = 6\$, \$7-3 = 4\$, \$7-2-1 = 4\$, and \$6-3-1=2\$ respectively, so the last three all work.
Scoring
This is code golf: Shortest solution in bytes wins.
Test cases:
Any reordering of the output is equally good, so for input (3, 3), outputs [[3],[2,1]] or [[2,1],[3]] are equally acceptable (however [[1,2],[3]] isn't).
Input: 1, 1
Output: [[1]]

Input: 3, 3
Output: [[2,1], [3]]

Input: 3, 1
Output: [[2,1]]

Input: 6, 6
Output: [[6], [5, 1], [4, 2]]

Input: 6, 4
Output: [[5,1], [4,2]]

Input: 6, 1
Output: []

Input: 7, 7
Output: [[7], [6,1], [4,2,1], [5,2]]

Input: 7,1
Output: [[4,2,1]]

Input: 10, 10
Output: [[10], [9,1], [7,2,1], [6,3,1], [8,2], [7,3]]

Input: 10, 5
Output: [[7,3], [7,2,1], [6,3,1]]

Input: 26, 4
Output: [15, 7, 3, 1]

Input: 26, 6
Output: [[16, 7, 2, 1], [16, 6, 3, 1], [15, 7, 3, 1], [16, 8, 2], [16, 7, 3]]

Okay, I will provide a brief explanation.

05AB1E, 16 12 bytes
Saved 4 bytes thanks to Grimy
Åœíʒx¦@P}ʒÆ@

Try it online!
Explanation
Åœ              # integer partitions
  í             # reverse each
   ʒ    }       # filter, keep only elements true under:
    x           # each element doubled
     ¦          # remove the first element in the doubled list
      @         # compare with greater than or equal with the non-doubled
       P        # product
         ʒ      # filter, keep only elements true under:
          Æ     # reduce by subtraction
           @    # compare with greater than or equal to second input

ćsO- is the built-in Æ.

Also À@¨ can be ¦@.

@Grimy: Oh wow, how did I miss that :) Thank you!

Wolfram Language (Mathematica), 67 62 bytes
Cases[IntegerPartitions@#,a_/;2a[[1]]-#<=#2>Max@Ratios@a<=.5]&

Try it online!
-4 bytes by @attinat

IntegerPartitions@d : Get all lists of integers summing to d
Cases[,...]: Filter by the following condition:

2#& @@# - d <= e &&: Twice the first element minus the sum is less than e, and...
Max@Ratios@#<=.5: Ratios of successive elements of the list are all less than 1/2.

Because e is less than .5, we can turn this into a chained inequality.
For a few extra bytes, this is significantly faster: Try it online!

63 bytes

Jelly,  16  15 bytes
-1 thanks to Erik the Outgolfer (a smart adjustment to the checking allowing a single filter)
:Ɲ;_/>¥’Ạ
ŒṗUçƇ

A dyadic link accepting a positive integer, d, on the left and a positive integer, e, on the right which yields a list of lists of positive integers.
Try it online! (the footer formats the results to avoid list the implicit list formatting Jelly does as a full program)
How?
:Ɲ;_/>¥’Ạ - Link 1: admissible and within excess limit? descending list, L; excess limit, e
 Ɲ        - neighbour-wise:
:         -   integer division  -- admissible if all these are >1
      ¥   - last two links as a dyad - i.e. f(L,e):
    /     -   reduce (L) by:
   _      -     subtraction
     >    -   greater than (e)? (vectorises)  -- within excess if all these are ==0
  ;       - concatenate
       ’  - decrement (vectorises)
        Ạ - all (non-zero)?

ŒṗUçƇ - Main link: integer, d; integer, e
Œṗ    - partitions (of d)
  U   - reverse each
    Ƈ - filter keep those (v in that) for which:
   ç  -   call last Link (1) as a dyad - i.e. f(v, e)

You can save a byte with a clever trick. It may take a little while to understand why that works. :P

@EriktheOutgolfer awesome, I had tried some similar ways to inline the two filters  (including concatenation), but everything was coming out as 16 since I did not think of employing the decrement trick at the same time.

Haskell, 59 58 54 bytes
1 byte saved thanks to nimi
4 bytes saved thanks to xnor
0#_=[[]]
d#m=do i<-[1..div(m+d)2];(i:)<$>(d-i)#(2*i-d)

Try it online!

You can save some bytes by defining # directly: Try it online!

Python 3, 213 bytes

Giant list comprehension.  Most likely not the best way to do this, but I can't figure out how to skip the if statements
import itertools as z
f=lambda d,e:[c for c in [[b for b in list(z.permutations(range(1,d+1),i)) if sum(b)==d and b[0]-sum(b[1:i])<=e and all([b[i]>=b[i+1]*2 for i in range(len(b)-1)])] for i in range(1,5)] if c]

Python 3, 172 bytes
from itertools import*
r=range
f=lambda d,e:filter(len,[[b for b in permutations(r(1,d+1),i)if d==sum(b)and~e<d-2*b[0]and all(i>=j*2for i,j in zip(b,b[1:]))]for i in r(5)])

Try it online!
As according to edits by @Jonas Ausevicius

Welcome to the site.  A few tips:  I looks like you are not super familiar with where spacing is required in python.  You have a couple of places that spaces could be removed just fine, so I would look into that.  Also functions like all can take a generator so you can just do all(...) instead of all([...]).  Lastly since your submission is a completely anonymous function you are not penalized for the assignment (f=) and thus can deduct it from your score (-2 bytes).

With those changes your answer is down to 201 bytes

Oh and also in python3 you can cast to list with [*(...)] instead of list(...) which usually saves a byte but in your case saves 2 since it also allows you to remove a space.

Oh and one last thing: you can find tips for golfing in python from people more experienced than me on out tips for python question.  Happy golfing!

from itertools import* saves one byte

189 bytes if it's fine to return a filter object, otherwise 192 with [*filter(...)]. Also welcome :)

179 bytes

172 bytes

I second the others' welcome. Just so you know, it's very accepted on this site that you edit your answer to incorporate others' suggestions, so long as you credit them in the answer ("saved 3 bytes due to user_whomever and 4 bytes due to msh210" or the like; in this case perhaps just "saved N bytes thanks to user_a, user_b, and user_c" to keep it simple).

JavaScript (V8),  88 87  81 bytes
Takes input as (e)(d). Prints the sequences to STDOUT.
e=>g=(d,s=x=d,a=[])=>s>0?d&&g(d-1,s,a,g(d>>1,s-d,[...a,d])):a[s]*2-x<=e&&print(a)

Try it online!
Commented
e =>                  // e = maximum excess
  g = (               // g is a recursive function taking:
    d,                //   d   = expected degree; actually used as the next candidate
                      //         term of the sequence in the code below
    s =               //   s   = current sum, initialized to d; we want it to be equal
                      //         to 0 when a sequence is complete
    x = d,            //   x   = copy of the expected degree
    a = []            //   a[] = current sequence
  ) =>                //
    s > 0 ?           // if s is positive:
      d &&            //   if d is not equal to 0:
        g(            //     outer recursive call:
          d - 1,      //       decrement d
          s,          //       leave s unchanged
          a,          //       leave a[] unchanged
          g(          //       inner recursive call:
            d >> 1,   //         update d to floor(d / 2)
            s - d,    //         subtract d from s
            [...a, d] //         append d to a[]
          )           //       end of inner recursive call
        )             //     end of outer recursive call
    :                 //   else:
      a[s] * 2 - x    //     s if either 0 (success) or negative (failure)
                      //     if s is negative, a[s] is undefined and this expression
                      //     evaluates to NaN, forcing the test to fail
      <= e            //     otherwise, we test whether the excess is valid
      && print(a)     //     and we print a[] if it is

Pyth, 23 bytes
f!>-FTvzf!<#2/MCtBT_M./

Try it online!
f!>-FTvzf!<#2/MCtBT_M./Q   Implicit: Q=input 1, vz=input 2
                           Trailing Q inferred
                     ./Q   Generate partitions of Q (ordered lists of integers which sum to Q)
                   _M      Reverse each
        f                  Filter keep elements of the above, as T, where:
               CtBT          Pair the set with itself without the first element and transpose
                             This yields all adjacent pairs of values
             /M              Integer divide each pair
           #                 Filter keep elements...
          < 2                ... less than 2
                             For admissible sequences this will be empty
         !                   Logical NOT - maps [] to true, populated lists to false
                           Result of filter are all admissible sequences
f                          Filter keep the above, as T, where:
   -FT                       Reduce T by subtraction to get degree
 !>   vz                     Is the above not greater than vz?
                           Implicit print

Charcoal, 42 bytes
Ｆθ⊞υ⟦⊕ι⟧ＦυＦ…·⊗§ι⁰θ⊞υ⁺⟦κ⟧ιＩΦυ›⁼Σιθ‹η⁻⊗§ι⁰Σι

Try it online! Link is to verbose version of code. Explanation:
Ｆθ⊞υ⟦⊕ι⟧

First create a list of lists from [1]..[d].
ＦυＦ…·⊗§ι⁰θ⊞υ⁺⟦κ⟧ι

For each list create new lists by prefixing all the numbers from the doubled first number up to d and append those lists to the list of lists to be processed. This ensures that all admissible sequences containing numbers not greater than d are created.
ＩΦυ›⁼Σιθ‹η⁻⊗§ι⁰Σι

Output only those lists whose degree is d and excess is not greater than e. (The sum of the degree and excess is equal to twice the first number of the list.)

Python 3, 156 bytes
lambda d,e:[x for y in range(5)for x in permutations(range(1,d+1),y)if all(i>=j*2for i,j in zip(x,x[1:]))and d==sum(x)and~e<d-2*x[0]]
from itertools import*

takes d,e as input; outputs list of tuples
Similar to @OrangeCherries answer and help from comments; but more bytes saved
Try it online!

Jelly, 18 bytes
ŒṗU:Ɲ’ẠƊƇUṪ_SƊ’<ʋƇ

Try it online!

Ruby, 78 bytes
g=->(d,e,m=1){d<m ?[]:g[d-m,e+m,m*2].map{|q|q+[m]}+g[d,e,m+1]|(d>e ?[]:[[d]])}

Try it online!


text:
Who can escape the Nonary Game?
The Nonary Game is a fictional game played in the video game trilogy of the same name. Your goal is to find how many players (at best) can escape a given game, in as few bytes of code as possible.
Rules of the game

There are 9 players, numbered 1 to 9.
All players start in the same room.
There are any number of doors, each one with a 1 to 9 number. There may be duplicate or missing door numbers.
Door are one-way connections between rooms. Each door can only be used once.
Only groups of 3 to 5 players can go through a door.
A group can only go through a door if the sum of their numbers modulo 9 matches the door’s number modulo 9.
Any player who goes through a 9 door escapes (wins).

Examples
┌───┬───┬───┐
│   6   4   9
│ < │   |   |
│   3   5   9
└───┴───┴───┘

< represents the starting point. All players start there.
In this setting, everybody can escape. There are various ways to achieve this, one of which is:

[1, 2, 3, 4, 5] go though door 6 ((1+2+3+4+5) % 9 = 6), while [6, 7, 8, 9] go through door 3 ((6+7+8+9) % 9 = 3). Everybody meets up in the second room.
[1, 2, 3, 7] go through door 4, while [4, 5, 6, 8, 9] go through door 5.
[1, 2, 3, 4, 8] go through one of the 9 doors, [5, 6, 7, 9] go through the other one.

┌───┬───┐
│   │   |
│ < 8   9
│   │   |
└───┴───┘

This time, at most 4 people can escape:

[1, 3, 5, 8, 9] go through door 8.
[1, 3, 5, 9] go through door 9.

Other lists of survivors are possible, such as [2, 3, 4] or [1, 4, 6, 7], but there's no way for more than 4 people to escape.
The challenge
Given a map, output the maximum numbers of player who can escape.

Don’t worry, you don’t need to parse my awful diagrams! Input is a labeled directed graph, which you can represent in any convenient format (edge set, adjacency matrix...).
If your representation requires labels for rooms, you can use any consistent set of values. However, doors must be represented by the integers 1 to 9.
The input will always have at least one 9 door. All 9 doors always lead to the exit, while other doors never do.
Your submission can be a function or full program.
Standard loopholes are banned.

Test cases
Inputs are shown as lists of [door number, from room, to room] triplets, with 0 being the starting room and -1 being the exit. If you choose to use another format, you’ll have to convert them appropriately.
Input                                                                      Output
[[6, 0, 1], [3, 0, 1], [4, 1, 2], [5, 1, 2], [9, 2, -1], [9, 2, -1]]       9
[[8, 0, 1], [9, 1, -1]]                                                    4
[[9, 0, -1]]                                                               5
[[2, 0, 1], [1, 1, 2], [9, 2, -1]]                                         0
[[2, 0, 1], [3, 1, 2], [9, 2, -1]]                                         3
[[1, 0, 1], [9, 1, -1], [1, 0, 2], [9, 2, -1]]                             4
[[2, 0, 1], [3, 0, 1], [5, 1, 2], [4, 0, 2], [9, 2, -1], [9, 2, -1]]       8
[[3, 0, 1], [4, 0, 1], [5, 0, 1], [9, 1, -1], [7, 1, 2], [9, 2, -1]]       7
[[1, 0, 1], [2, 0, 1], [4, 0, 1], [9, 1, -1], [8, 1, 2], [9, 2, -1]]       6
[[6, 0, 1], [7, 0, 1], [9, 1, -1], [9, 1, -1]]                             7

I know it's a relic of the game being 999, but it bugs me that you need to mod the door number by 9 because they don't want to escape through Door 0.

It might be worth making clearer in the description and pictorial examples that some doors bypass rooms. Also can doors ever go backwards? I.e. some people might go 0->1->exit and others go 0->2->1->exit?

@NickKennedy not sure what you mean by “bypass”. Doors can connect any room to any other room. It’s a directed graph.

If you think this series of rules could be made more interesting with the threat of spontaneous explosion as soon as anyone makes a mistake, please give the game a try. It's great.

@Grimy sure, but the pictorial examples and the first 5 actual examples have all of the doors leading from one room to the next one to the right.

@Abigail Yes, it can. Note that this shouldn't be difficult to handle: thanks to the "each door can only be used once" rule, you really shouldn't get stuck in an infinite loop.

JavaScript (ES6), 219 bytes
A slower but significantly shorter version using bitmasks instead of strings.
f=(D,P=[511],e=m=0)=>P.map((X,r)=>[...Array(-~X)].map((_,p)=>D.map(([d,s,t],j)=>(N=(g=(n,k)=>n&&n%2+g(n>>1,++k,x+=n%2*k))(p&=X,x=0))<3|N>5|r-s|x%9^d%9||f(D.filter(_=>j--),A=[...P],e+!~t*N,A[r]^=p,A[t]^=p))),m=m>e?m:e)|m

Try it online!
NB: The reason why it's slower is that we do not compute the powersets of the players. Given a bitmask of players \$X\$, we iterate on all \$(X \operatorname{AND} p)\$ for \$0\le p\le X\$ without deduplicating.

JavaScript (ES7),  293 272  271 bytes
Takes input in the format described in the challenge. This is a brute force search.
f=(D,P=[17**6+'8'],e=m=0)=>P.map((X,r)=>X&&[...X].reduce((a,x)=>[...a,...a.map(y=>y+x)],['']).map(p=>D.map(([d,s,t],j)=>p<99|p[5]|r-s|eval([...p].join`+`)%9^d%9||f(D.filter(_=>j--),A=[...P],e+!~t*p.length,A[r]=X.replace(eval(`/[${p}]/g`),''),A[t]=[A[t]]+p))),m=m>e?m:e)|m

Try it online! (the first test case times out on TIO)
How?
The array P[] holds a list of strings describing the players in each room.
We start with P=['241375698'] (using \$17^6=24137569\$), which means that all players are initially located in room \$0\$.
For each room X at position r, we compute the powerset of X:
[...X].reduce((a, x) => [...a, ...a.map(y => y + x)], [''])

For each group of players p in there and for each door [d,s,t] at index j, we test if the group is unable to pass through the door:
                         // we can't pass if:
p < 99 |                 // there are less than 3 players
p[5] |                   // or there are more than 5 players
r - s |                  // or the source room s is not equal to the current room
eval([...p].join`+`) % 9 // or the sum of the players modulo 9
^ d % 9                  // does not match the ID of the door modulo 9

If the group can pass, we do a recursive call:
f(                       //
  D.filter(_ => j--),    // remove the door that has just been used from D[]
  A = [...P],            // use a copy A[] of P[]
  e + !~t * p.length,    // if t = -1, add the length of p to e (number of escaped guys)
  A[r] = X.replace(      // remove the players from the source room A[r]
    eval(`/[${p}]/g`),   //
    ''                   //
  ),                     //
  A[t] = [A[t]] + p      // and append them to the target room A[t]
)                        //

We keep track of the maximum number of escaped players in m and eventually return it.

Are you just trying all possibilities?

@Jonah Yes. It may be either very fast or very slow depending on the constraints implied by the input.

Jelly, 76 bytes
2ịịœc3r5¤ẎS,%9EʋƇ1ị${ḟ@;ƭⱮ€Ḋị¥ż€Ḋ{ṛṪ}¦ƒ€
ç@€Ẏ;ḷṢ€€Q
“”WẋḊ€FṀƊ9RW¤;Wçƒ@⁸ẈṪ$€Ṁ

Try it online!
A full program taking a single argument, a directed graph using rooms 1, 2, ... and 0 as exit. Returns an integer which is the maximum number that can escape. Full explanation to follow.
Should run without the Ṣ€€Q for a 4-byte saving but slow to rest.

Python3, 402 bytes
Little long, but very fast:
from itertools import*
R=range
O=sorted
def f(r):
 q=[({0:{*R(1,10)}},r,0)]
 l,S=[],[]
 for D,r,C in q:
  l+=[len(D.get(-1,[]))]
  for i in D:
   for t in R(3,6):
    for j in combinations(D[i],t):
     for a,b in enumerate(r):
      if b[0]%9==sum(j)%9 and b[1]==i:
       if(str(U:={**D,i:O({*D[i]}-{*j}),b[2]:O({*D.get(b[2],[]),*j})}))not in S:q+=[(U,r[:a]+r[a+1:],C)];S+=[str(U)]
 return max(l+[0])

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
New Site Design!
Unless you have a userscript that modifies the site's design (or even if so), you should have noticed that we have our site design!
(It's November now)
So, to celebrate, let's make a program that retroactively applies this design (oversimplified, of course)!
So, the most important changes are:

our new name is now Code Golf and Coding Challenges
our site is no longer the default blue color and is instead a nice dark green

So, given a string, change:

PPCG to CGCC
Programming Puzzles {non-whitespace} Code Golf to Code Golf {same-thing} Coding Challenges (for example, Programming Puzzles + Code Golf, and Code Golf, and & Code Golf would all be changed to Code Golf + Coding Challenges, and Coding Challenges, and & Coding Challenges.
#abc to #acb (swap blue to green and vice versa - just ignore the fact that green shouldn't logically become blue but I don't want to complicate the color shifting)
#abcdef to #abefcd (same as above)

Note that for the color swaps, you should accept any hexadecimal digit from 0-9 to a-f. You can choose what case of hex digit to require, but it must be consistent and the same from input to output.
Your substitutions can be case-sensitive, and if not, please specify how the output works.
The substitutions should only happen when the string is surrounded by word boundaries (including the start of the #). In other words, each of the specified substitutions should only occur if the match is at the edge of the string or is bordered by non-alphanumeric characters (on both sides).
Standard loopholes apply. This is a code-golf challenge, so the shortest code wins!
Examples
PPCG -> CGCC
Programming Puzzles or Code Golf -> Code Golf or Coding Challenges
PPCG stands for Programming Puzzles and Code Golf and its site color is #abf -> CGCC stands for Code Golf and Coding Challenges and its site color is #afb
The color #00f is much more intense than #5568ed -> The color #0f0 is much more intense than #55ed68
Programming Puzzles and No Substitution -> Programming Puzzles and No Substitution
No Substitution and Code Golf -> No Substitution and Code Golf
Programming Puzzles and no substitution Code Golf -> Programming Puzzles and no substitution Code Golf
Code Golf and Programming Puzzles -> Code Golf and Programming Puzzles
Programming Puzzles and Programming Puzzles and Code Golf -> Programming Puzzles and Code Golf and Coding Challenges

(for the last test case, it is important to note that the translated string could be translated again but the transformation must be applied exactly once)
Important Update
(Thanks @tsh)
The Programming Puzzles ... Code Golf substitution rule can include the other rules inside of it (Programming Puzzles PPCG Code Golf is valid). In this case, you may choose whether or not the rules are applied, but it must be deterministic. I'm not requiring that you be consistent between PPCG and #... because answers seem to implement the rules in my list ordering which results in inconsistencies. This is just a clarification; I believe all current answers remain valid.

Should be apply the substitutions only if there are word boundaries around the substrings or everywhere?

@EriktheOutgolfer Good catch; should have word boundaries. I will specify that; thanks.

Define "word boundary" for a #; regex implementations generally don't consider a # to start a word.

@tomsmeding I'm just going to make it so that the substitutions have to be at the edge of the string or have non-alnum around it

Got test cases?

@ValueInk added some, thanks

May one keyword appear multiple times in a testcase? May some testcases doesn't contain any of these words? If so, I would suggest that include at least one of such thing.

Is Programming Puzzles #123 Code Golf, Programming Puzzles PPCG Code Golf valid testcases? What is expected to be outputed?

@tsh I never thought about that, good catch. Since the answers are inconsistent between the two, I'm going to say that you can choose whether or not the joiner for Programming Puzzles ... Code Golf gets modified. Thanks.

@Veskah Will add, thanks.

Oh, I guess Programming Puzzles and no substitution Code Golf might also catch someone (even though everyone's using the same valid regex)

@Veskah That's a good one too, though I don't think that would happen (\S is a bit too easy to screw up :P). I'll add it anyway

Suggested test cases Code Golf and Programming Puzzles and Programming Puzzles and Programming Puzzles and Code Golf. @Veskah Hmm, and I think that last suggested test case fails in my 05AB1E answer, since I don't have regex.. >.< Back to the drawing board..

@KevinCruijssen Added, thanks

Suggested test case: color-#00f- (not surrounded by whitespace). Also, \b in regexes is usually A-Za-z0-9_, so do we need to include the _  as well (since you mention non-alphanumeric, I could interpret this as not; which would invalid almost all answers). Or is either with or without fine?

I didn't think it would happen during my lifetime.

@coredump lol... I mean, it only took 4-6 weeks ;)

Stax, 85 bytes
ì▀¼FΣ¼≤C╛╓ÄydîNû►┘Δ▲Bd♫|α╒oñFτ▒t!↑▌╩┘♦pMc6Hèé▄·│╝∙↔¥^4b5╠·9█&╨^╨♂═î£ε■å±«\┴J₧å♠Å≡z╜û♀

Run and debug it

Ruby -p, 165 164 159 bytes
It ended up being very similar to the sed answer, but it abuses Ruby's string interpolation to duplicate the hex group matching ([\da-f]{1,2}) within the third regex three times instead of needing to repeat the whole thing again.

-1 byte from @randomdude999.
-5 bytes from leveraging @Xcali's Perl solution

gsub /\bPPCG\b/,"CGCC"
gsub /\bProgramming Puzzles( \S+ )(Code Golf)\b/,'\2\1Coding Challenges'
[1,2].map{|i|gsub /(^|\s)#\K#{'([\da-f]{%d})'%i*3}\b/,'\2\4\3'}

Try it online!

Doesn't using {1,2} break with hex inputs of length 4 or 5, e.g. #aabbc? Edit: it does (this example should not be replaced because it's not a valid hex color).

Fails for this case (- is a non-alphanumeric character).

@randomdude999 yeah, good catch. Added a check for that.

@EriktheOutgolfer yeah, I guess. "Word boundaries" with the # is a bit ambiguous since /\b/ doesn't register with it next to another non-alphanumeric, but I did the change anyways for no byte change (replacing \S with \w)

Can't you replace your (?<!\w) with my (^|\W) for 1 char?

1 more byte can be saved by changing ...Puzzles( \S+) (Code... -> ...Puzzles (\S+ )(Code... and ...'\2\1 Coding... -> ...'\2\1Coding...

@tomsmeding (^|\W) is an additional matching group that must be outputted again at the end, so it saves 1 byte there but adds 3 to the gsub output ($1+), for a total of +2 bytes gain.

@randomdude999 fixed, thanks! Although, the match was supposed to be ( \S+ ), not (\S+ ) ;)

C++ (gcc), 270 285 283 bytes
Thanks to Neil for pointing out a bug.
-2 bytes thanks to ceilingcat.
#import<regex>
#import<string>
auto f=[](auto s){typeof(s)R[][2]{"bPPCG","CGCC","bProgramming Puzzles( \\S+ )(Code Golf)","$2$1Coding Challenges","B#(?=([\\da-f]{3}){1,2}\\b)(.+?)(..??)(..??)","#$2$4$3"};for(auto r:R)s=std::regex_replace(s,std::regex('\\'+*r+"\\b"),r[1]);return s;};

Try it online!

Seems to mangle #fade and #faced which it should not.

Retina 0.8.2, 153 130 bytes
\bPPCG\b
CGCC
\bProgramming Puzzles( \S+ )(Code Golf)\b
$2$1Coding Challenges
\B(#(?=([\da-f]{3}){1,2}\b).+?)(..??)(..??)\b
$1$4$3

Try it online! Link includes test cases. All substitutions are case sensitive. Assumes normal regex word characters are acceptable so that \B# matches only #s that don't follow a word character. Edit: Saved 22 bytes thanks to @tsh.

Try \B#(?=([\da-f]{3}){1,2}\b)(.+?)(..??)(..??)\b?

GNU sed -E, 198 chars
s/\bPPCG\b/CGCC/g
s/\bProgramming Puzzles( \S* Cod)e Golf\b/Code Golf\1ing Challenges/g
s/((^|\W)#[0-9a-f])([0-9a-f])([0-9a-f])\b/\1\4\3/g
s/((^|\W)#[0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/\1\4\3/g

Runnable using e.g. sed -E 'the above'; newlines can either be included literally, or replaced with ; if you so wish. Both work.
@HyperNeutrino come on that word boundary rule is stupid. Look what I had to do in the # case.
Yes, I didn't even try. :P
+9 by @Value Ink

Flags are no longer included in byte counts so you can take out the extra byte and call it "GNU sed -E" instead.

@ValueInk Whaaaaat? I have apparently been severely out of touch with this community for too long to not notice that. I think it's a good rule though. Also, thanks for mentioning.

doesn't sed's regex matching allow using \d as a shortcut for 0-9? could save you a whole 6 bytes

Also I just noticed, you return "Programming Puzzles or Coding Challenges" for the second test case instead of the expected "Code Golf or Coding Challenges".

@randomdude999 The re_format(7) man page on my Mac seems to suggest that sed should support \d, but apparently it doesn't. ¯\(ツ)/¯

Hm, just checked and indeed Posix extended regular expressions do not support single-letter character classes. Probably re_format/7) documents syntax of Perl regular expressions, not Posix extended REs.

05AB1E, 123 109 105 110 114 bytes
žKISå_Å¡JεÐć'#QsžhA6£«sSåP*i3äćsRJ«ë"PPCG"Qi"CGCC"]J”–±ÇÀ”DU¡ćsε”ƒËŠˆ”©¡DVćDÁ2ôεðå}ćs_P*YyÊP*i”Âïªï”«s®ý«®ìëyXì]J«

+5 bytes fixing test cases like Programming Puzzles and no substitution Code Golf and Programming Puzzles and Programming Puzzles and Code Golf.
+4 bytes fixing test cases like color-#00f (colors with something besides spaces/newlines surrounding it). Thanks to @Grimy for bringing this to my attention.
Case-sensitive. Hexadecimal values are with lowercase abcdef; Programming Puzzles ... Code Golf is in titlecase; PPCG is in full uppercase.
Try it online.
Definitely not the right language for the job.. Mimicking word-boundaries and replacing Programming Puzzles \S+ Code Golf, but not Code Golf \S+ Programming Puzzles or Programming Puzzles \S+ \S+ Code Golf without any regexes is pretty hard (to do short).. >.>
Explanation:
žK                # Push "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
                  # (NOTE: if '_' also count as word boundary, use `žj` instead)
  IS              # Push the input as a list of characters
    å_            # Check for each character if they are NOT in the string
      Å¡          # Split the (implicit) input on truthy values
        J         # Join each inner character list to a string again
ε                 # Map each word to:
 Ð                #    Triplicate the word
  ć               #    Extract head; push remainder and head separately to the stack
   '#Q           '#    Check if the head equals "#"
    žh            #    Push string "0123456789"
      A6£«        #    Append the first 6 letters of the alphabet: "0123456789abcdef"
   s      sSåP    #    Check if the characters of the remainder are all in this string
   *i             #    If both are truthy:
     3ä           #     Split the 'word' into three parts
                  #      i.e. "#ab12cd" → ["#ab","12","cd"]
       ćs         #     Extract head, and swap
         R        #     Reverse the remainder list
          J«      #     Join them together, and merge them to the head again
    ë"PPCG"Qi     #    Else-if the word is "PPCG":
     "CGCC"       #     Push "CGCC"
                  #    (Implicit else:
                  #      Use the word that's still there from the initial triplicate)
]                 # Close all if statements and the nested map
 J                # Join the mapped words together again
”–±ÇÀ”            # Push dictionary string "Programming Puzzles"
      DU          # Save a copy in variable `X`
        ¡         # Split the string by this
         ćs       # Extract head & swap; pushing head and remainder to the stack
ε                 # Map each substring `y` in the remainder to:
 ”ƒËŠˆ”           #  Push dictionary string "Code Golf"
       ©          #  Save it in variable `®` (without popping)
        ¡         #  Split the current substring we're mapping by it
         DV       #  Save a copy of this list in variable `Y`
           ćD     #  Extract the head and duplicate
                  #  (so the stack is: remainder, head, head)
 Á                #  Rotate the characters in the head-string once towards the right
  2ô              #  Split it into parts of size 2
    εðå}          #  Check in each part if it contains a space
        ćs        #  Extract head and swap again
          _       #  Check if all values are 0
           P      #  And check if this is truthy for all
          *       #  And check if this is truthy, as well as the head
                  #  (this means the current string has a leading and trailing space,
                  #   and no other spaces)
 YyÊP             #   Check that none of the susbtrings in variable `Y`
                  #   are equal to the current substring `y`
 *i               #   If both checks above are truthy:
   ”Âïªï”«        #    Prepend "Coding Challenges" to the duplicated head
          s®ý     #    Join the remainder by variable `®` ("Code Golf")
             «    #    Append it
              ®ì  #    And prepend an additional variable `®` ("Code Golf")
  ë               #   Else:
   y              #    Simply keep the substring `y` as is
    Xì            #    And prepend variable `X` ("Programming Puzzles")
                  #    since we've split by it
]                 # Close all if-else statements and the map
 J                # Join the mapped substrings together to a single string
  «               # And append it to the initially extracted head
                  # (then output the resulting string implicitly as result)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ”–±ÇÀ” is "Programming Puzzles"; ”ƒËŠˆ” is "Code Golf"; and ”Âïªï” is "Coding Challenges".

Python 2, 240 bytes
import re
lambda x,s=re.sub,b='(?<!\w)',e='(?!\w)',h='([\da-f]',t=r'#\1\3\2':s(b+'#%s{2})'%h+h+'{2})%s{2})'%h+e,t,s(b+'#%s)'%h+h+')%s)'%h+e,t,s(b+'Programming Puzzles( \S+ Cod)e Golf'+e,r'Code Golf\1ing Challenges',s(b+'PPCG'+e,'CGCC',x))))

Try it online!

JavaScript (Node.js), 174 bytes
s=>s[R='replace'](/\bPPCG\b/g,'CGCC')[R](/\bProgramming Puzzles( \S+ )(Code Golf)\b/g,'$2$1Coding Challenges')[R](/\B#(?=([\da-f]{3}){1,2}\b)(.+?)(..??)(..??)\b/ig,'#$2$4$3')

Try it online!

Fails on test case #abcde because the regex qualifier {3,6} matches between 3 and 6 characters, instead of either 3 or 6 which I assume you were going for.

@ValueInk nice catch. fixed with +5 bytes.

Might be shorter to use a replace function over the long regex

Pyth, 177 173 162 142 bytes
J::jb.z"\\bPPCG\\b""CGCC"." z¶NZI°Pÿúd(MÜ_BöIkxnqä'u)"." s6#~ÍN³=<nñu/GÎg"VS2~:J%"(^|\W)#%s\\b"*3%"([\da-f]{%d})"N$r"\1#\2\4\3"$)J

Here's a version without Pyth's string compression mechanisms (aka it's safe to copy-paste):
J::jb.z"\\bPPCG\\b""CGCC""\\bProgramming Puzzles( \S+ )(Code Golf)\\b""\\2\\1Coding Challenges"VS2~:J%"(^|\W)#%s\\b"*3%"([\da-f]{%d})"N$r"\1#\2\4\3"$)J

Try it online!
This ended up being really long because I tried to be as pedantic as possible with the regexes. I tried to compress every string possible, but most of them either didn't get smaller or couldn't be pasted into TIO properly.
Explanation:
J::                      # definition of J to the following 2 regex replacements
   jb.z                  # input to first regex replacement: all input lines joined together
   "\\bPPCG\\b"          # first regex
   "CGCC"                # first replacement
   ."<compressed>"       # second regex: "\\bProgramming Puzzles( \S+ )(Code Golf)\\b"
   ."<compressed>"       # second replacement: "\\2\\1Coding Challenges"
VS2                      # loop twice, N = 1 or 2
  ~:J                    # some weird assignment: J = regex replace in J (would be J := (regex, replacement) if : was python's regex replace operator)
    %                    # third regex: string format
     "(^|\W)#%s\\b"      # format string
     *3                  # repeat 3 times:
       %"([\da-f]{%d})"N # string format, replace %d with N (the loop counter)
    $r"\1#\2\4\3"$       # third replacement: uses python raw literals because it's shorter than escaping the backslashes
    )                    # end for loop
J                        # print J

-11 thanks to a better regex from Value Ink's Ruby answer
-20 thanks to using a loop for both of the hex replacements, inspired by the Ruby and Perl answers

Perl 5 -p, 152 145 bytes
@ValueInk saves 7 bytes
s/\bPPCG\b/CGCC/g;s/\bProgramming Puzzles( \S+ )(Code Golf)\b/$2$1Coding Challenges/g;for$a(1,2){$p="([a-f0-9]{$a})"x3;s/(^|\s)#\K$p\b/$2$4$3/gi}

Try it online!

( \S+ )(Code Golf)\b/$2$1Coding saves 2 bytes. Also the last regex can end with just a \b instead of (?=\s|$)

I was working on that first one while you were typing that comment.  I've made the other change to save some bytes.  Thanks!

That \s should be \W instead, otherwise it fails this case (- is a non-alphanumeric character, so the substitution should be applied).

137

Java 8, 192 bytes
s->s.replaceAll("\\bPPCG\\b","CGCC").replaceAll("\\bProgramming Puzzles( \\S+ )(Code Golf)\\b","$2$1Coding Challenges").replaceAll("\\B(#(?=([0-9a-f]{3}){1,2}\\b).+?)(..??)(..??)\\b","$1$4$3")

Port of @Neil's Retina answer, so make sure to upvote him!
Try it online.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/