Skip to content

This is an adaptation of the Ninety-Nine Prolog Problems written by Nick Chen. Now implement by Scala.

Notifications You must be signed in to change notification settings

nickChenyx/99problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

99 Problems

Scala !!!

Lists

  • P01 (*) Find the last element of a list
  • P02 (*) Find the last but one element of a list.
  • P03 (*) Find the Kth element of a list.
  • P04 (*) Find the number of elements of a list.
  • P05 (*) Reverse a list.
  • P06 (*) Find out whether a list is a palindrome.
  • P07 (*) Flatten a nested list structure.
  • P08 (*) Eliminate consecutive duplicates of list elements.
  • P09 (*) Pack consecutive duplicates of list elements into sublists.
  • P10 (*) Run-length encoding of a list.
  • P11 (*) Modified run-length encoding.
  • P12 (*) Decode a run-length encoded list.
  • P13 (*) Run-length encoding of a list (direct solution).
  • P14 (*) Duplicate the elements of a list.
  • P15 (*) Duplicate the elements of a list a given number of times.
  • P16 (*) Drop every Nth element from a list.
  • P17 (*) Split a list into two parts.
  • P18 (*) Extract a slice from a list.
  • P19 (*) Rotate a list N places to the left.
  • P20 (*) Remove the Kth element from a list.
  • P21 (*) Insert an element at a given position into a list.
  • P22 (*) Create a list containing all integers within a given range.
  • P23 (*) Extract a given number of randomly selected elements from a list.
  • P24 (*) Lotto: Draw N different random numbers from the set 1..M.
  • P25 (*) Generate a random permutation of the elements of a list.
  • P26 (*) Generate the combinations of K distinct objects chosen from the N elements of a list.

About

This is an adaptation of the Ninety-Nine Prolog Problems written by Nick Chen. Now implement by Scala.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages