https://medium.com/@eyajamuehaque/1579a-casimirs-string-solitaire-codeforces-solution-in-c-63c9ce2abf91