scala>decode("h2ll4")res2:String=helloscala>encode("hello")res3:String=h2ll4scala>decode("h3 th2r2")res4:String=hitherescala>decode("h2ll4")res5:String=helloscala>encode("This is an encoding test.")res6:String=Th3s3s1n2nc4d3ngt2st.scala>encode("How are you today?")res7:String=H4w1r2y45t4d1y?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A nice, simple, symmetric solution in Scala:
Tests: