Rotated Position of Integers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @ table(n varchar(9),i int identity(0,1))
INSERT @ VALUES(8),(49),(73),(102),(259),(762),
(2782),(3383),(9217),(37846),(89487),(7471788)

SELECT-sum(1/~(z*3))FROM(SELECT~i+rank()over(order by
substring(n+n,i%len(n)+1,len(n))*1)z FROM @)c

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results