This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func packetDescrambler(seq []int, fragmentData []string, n int) string { | |
maxSeqIdx := func(numSlice []int) int { | |
max := numSlice[0] | |
for _, n := range numSlice[1:] { | |
if n > max { | |
max = n | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
""" | |
Solves a problem of getting permutation of a given index, | |
while you know that permutations are created in a lexicographical order. | |
As input you are specifying a list of elements and index of permutation you want to get. | |
""" | |
## imports | |
from math import factorial | |
## this one just for checking |