Keep IT Simply Simple

My thoughts on tackling IT complexity by breaking it into atomic components. and I term it lego oriented solution, LOS for short.

Monday, October 5, 2009

P02: Find the last but one element of a list.

scala> List(1,2,3,4,5).takeRight(2).head
res0: Int = 4
Posted by Unknown at 9:55 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: scala

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2013 (1)
    • ►  February (1)
  • ►  2012 (2)
    • ►  September (1)
    • ►  February (1)
  • ►  2011 (4)
    • ►  August (1)
    • ►  June (2)
    • ►  January (1)
  • ►  2010 (10)
    • ►  July (1)
    • ►  June (2)
    • ►  May (3)
    • ►  April (2)
    • ►  February (1)
    • ►  January (1)
  • ▼  2009 (13)
    • ▼  October (13)
      • P12: Decode run-length encoding
      • P11: Modified run-length encoding that includes on...
      • Installing Eclipse, Scala and Groovy in Windows 7
      • P10: Run-length encoding of a list.
      • P09: Pack consecutive duplicates of list elements...
      • P08: Eliminate consecutive duplicates of list elem...
      • P07: Flatten a list
      • P06: Is a list palindrome
      • P03 - P05: Find nth element, length, reverse a list
      • How to simply sum values in a Map in Scala
      • Best Note Taking Tools
      • P02: Find the last but one element of a list.
      • Over all these years of Software development, I ca...
Simple theme. Powered by Blogger.