Python 3, 44 bytes
f=lambda n,m:int((n[-m%len(n):]+n)[:len(n)])
Try it online! Or see the test-suite.
Jonathan Allan
- 115.4k
- 8
- 68
- 293
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchangef=lambda n,m:int((n[-m%len(n):]+n)[:len(n)])
Try it online! Or see the test-suite.