Solution to S-99 ( P01 ~ P05 )
来源:互联网 发布:淘宝怎么提高浏览量 编辑:程序博客网 时间:2024/05/20 03:43
def last(data: List[Any]): Any = { if(data.size < 1) throw new IllegalArgumentException("List is too short") else return data.last } def penultimate(data: List[Any]): Any = { if(data.size < 2) throw new IllegalArgumentException("List is too short") else return data(data.size-2); } def nth(index: Int, data: List[Any]): Any = { if(data.size < index - 1) throw new IllegalArgumentException("Index is out of Range") else return data(index) } def length(data: List[Any]): Int = { return data.size } def reverse(data: List[Any]): List[Any] = { return data.reverse }
0 0
- Solution to S-99 ( P01 ~ P05 )
- p01
- p05
- Fundamental Solution to Pell's Equation
- cannot convert from 'wchar_t *' to 'ATL::CStringT ‘s solution
- cannot convert from 'wchar_t *' to 'ATL::CStringT ‘s solution
- The Solution to Leetcode 118 Pascal's Triangle
- The Solution to Leetcode 119 Pascal's Triangle II
- EU4-34:Proposing s solution to work issue
- 300s delay solution
- solution to Steps
- Solution to DeadLock
- How to get a solution?
- Solution Manager 2.1 To 7.1
- Solution to Printing Neatly Problem
- Converting VS2010 Solution to VS2008
- The Solution To All Errors
- Solution of Introduction to Algorithms
- Pig安装及简单实例
- 2014华为上机试题
- 内存管理技巧:如何避免JavaScript的内存泄露
- Codeforces 107B Basketball Team 简单概率
- SeLinux与Vsftp 的关系!
- Solution to S-99 ( P01 ~ P05 )
- 在VMware10中安装Ubuntu14.04LTS并开启主机文件共享
- Linux: libgcc_s.so.1 must be installed for pthread_cancel to work
- JS中自定义定时器
- 如何越狱苹果TV2在iOS 4.2使用PwnageTool
- 十大算法(二)
- 简单socket连接,tcp,备用
- unhandled event loop exception eclipse/An error has occurred.See the log file终于找到解决方法了
- 如何优化GNS3的CCNA实验室