Go version of 99 problems.
Professor Werner Hett created an interesting collection of 99 problems to practice programming. He created the collection with Prolog in mind, but it is adapted to many other languages. More info can be found here
This is an attempt to solve those problems using go programing language. The solutions provided here is neither the most elegant nor the best performing solutions.
- Find Last element of a list
- Find Last but one element of a list
- Find K th element of a list
- Count the number of elements in a list
- Reverse the elements in a list
- Check if the given list is palindrome
- Flatten a nested list structure
- Remove consecutive duplicates from a list
- Pack consecutive duplicates to sublist
- Run-length encoding of a list
- Modified run-length encoding of a list
- Decode a run-length encoded list
- Run-length encoding direct
- Duplicate elements of a list
- Duplicate elements of a list N times
- Drop every Nth element from a list
- Split a list into two parts, length of first part is given
- Extract a slice from a list
- Rotate a list N places to the left
- Remove Kth element from a list
- Insert given element at Kth position in a list
- Create a list containing all integers within a given range
- Randomly choose N items from a list
- Randomly choose N numbers from a given range
- Generate random permutation of a given list
- Find all the combinations of a given length from the given list
- TODO: Group a set into disjoint subsets
- TODO: Sort list of lists