Let x be the length of BC.  Then the length of CE is (45-x).
From the condition, you have this equation
   18^2 + x^2 = (45-x)^2 + 20^2,
saying that the two hypotenuses have equal lengths.
Simplify and find x
    18^2 + x^2 = 45^2 - 90x + x^2 + 20^2
    90x        = 45^2 + 20^2 - 18^2
    90x        = 2101
      x        =   = 23.344...   centimeters.     ANSWER