Leapfrogging
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Each input line is a sequence from 1 to 9 in random order.
If starting from position 0, output should be: which direction a jump is (either < or >) and how far a jump is to leapfrog over the next number. example input:
132
Visualizing each step would look like:
starting from pos 0:
_132
So to jump over '1' right (>) by one gives you:
1_32 (temp output = '>1' )
Now to jump past 2 you have jump right by 2:
132_ (temp output = '>1>2' )
Now jump past 3, you have to change the direction to left (<) and jump 2:
1_32 (temp ouput = '>1>2<2')
and that's it. Output for '132' is '>1>2<2'.
NOTE: each input line and each output line should be terminated by a newline (this includes the last one.)
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
132
Sample output:
>1>2<2
Sample input:_
214365879
Sample output:
>2<2>4<2>4<2>4<2>3
Sample input:_
162854973
142956837
952386417
193678524
764238591
752934186
285743619
954837621
961528734
278631549
Sample output:
>1>2>6<4<1<3>7<5>4
>1>2>5<7>4>1>3<3<3
>8<6>2>3<6>5>3<5<4
>1>7<6>7<3<3>2>1<5
>9<6>2<3>5<6<1>6>2
>7<5>3>1<5>8<9>8<5
>8<8>6<2<2>5<4<2>8
>9<2<3<2<1>6<2<2<3
>3>2>3>1<6<2>6<2<5
>6<6>5>3<2<3<2>2>6
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 72 | 0.0360 | 2014/11/23 00:48:40 | 0B / 22B / 43B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 106 | 0.0891 | 2014/11/14 04:15:20 | 0B / 53B / 42B |
2 | llhuii | 106 | 0.0882 | 2014/11/21 22:54:42 | 0B / 50B / 54B |
3 | whatisgolf | 106 | 0.0900 | 2014/11/23 07:07:18 | 0B / ?B / ?B |
4 | twobit | 107 | 0.1135 | 2014/11/13 08:09:18 | 0B / 54B / 42B |
5 | rolf | 108 | 0.0952 | 2014/11/23 00:33:29 | 0B / 55B / 42B |
6 | xsot | 112 | 0.1099 | 2014/11/21 23:20:44 | 0B / 57B / 53B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | twobit | 125 | 0.0333 | 2014/11/14 08:30:19 | 0B / 73B / 39B |
2 | AndoDaan | 500 | 0.0336 | 2014/11/10 09:04:58 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 100 | 0.0323 | 2014/11/18 09:49:14 | 0B / 47B / 53B |
2 | tails | 103 | 0.0324 | 2014/11/18 01:16:32 | 0B / 53B / 50B |
3 | twobit | 109 | 0.0320 | 2014/11/13 22:21:57 | 0B / 55B / 54B |
4 | whatisgolf | 113 | 0.0320 | 2014/11/16 06:55:15 | 0B / ?B / ?B |
5 | chocobi | 124 | 0.0320 | 2014/11/11 16:11:45 | 0B / 64B / 60B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | int-e | 114 | 0.0360 | 2014/11/21 21:21:11 | 0B / 61B / 50B |
2 | henkma | 120 | 0.0365 | 2014/11/15 00:08:23 | 0B / 63B / 52B |
3 | oerjan | 136 | 0.0338 | 2014/11/11 23:49:26 | 0B / 62B / 71B |
4 | int-e (henkma) | 113 | 0.0348 | 2014/11/24 11:06:18 | 0B / 60B / 49B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 61 | 0.0331 | 2014/11/17 04:12:54 | 0B / 27B / 33B |
2 | llhuii | 61 | 0.0320 | 2014/11/17 23:11:59 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 61 | 0.0499 | 2014/11/17 09:13:17 | 0B / 27B / 33B |
2 | llhuii | 61 | 0.0323 | 2014/11/17 23:12:06 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 40 | 0.0912 | 2014/11/22 22:29:11 | 0B / 8B / 32B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | fizzie | 50 | 0.0661 | 2014/11/17 03:15:40 | 0B / 28B / 22B |
2 | AndoDaan | 126 | 0.0504 | 2014/11/12 02:59:32 | 0B / 51B / 75B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | GolfScript | tails | 40 | 10000 |
2 | Burlesque | fizzie | 50 | 8000 |
3 | AWK | teebee | 61 | 6557 |
4 | xgawk | teebee | 61 | 6557 |
5 | Perl | tails | 72 | 5555 |
6 | JavaScript | _nderscore | 91 | 4395 |
7 | C | llhuii | 100 | 4000 |
8 | Python | leonid | 106 | 3773 |
9 | Python3 | llhuii | 113 | 3539 |
10 | Haskell | int-e (henkma) | 113 | 3539 |
11 | Lua | twobit | 125 | 3200 |
return to the top page