Last active
August 29, 2015 14:25
-
-
Save scottweaver/bafb0b9fc7ac6ff68027 to your computer and use it in GitHub Desktop.
Scala Problems
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
/* | |
* SUMMARY | |
* You have two case classes: One of the case classes, Settlement, may (via Option) contain | |
* the other one, TransactionInfo and TransactionInfo may contain a String. | |
* | |
* PROBLEM | |
* Provide a solution for checking whether or not the TransactionInfo's typeCode contained within | |
* the Settlement is one any one of the follwoing values "271", "272", "1", "0". In the case that either TransactionInfo or | |
* typeCode is None, the result should be false. | |
* | |
* HINTS | |
* - There are multiple ways to solve this. The goal is to find the most concise and functional way to solve the problem. | |
* - Make sure you account for the possibility of either (or both) TransactionInfo and typeCode not being set. | |
*/ | |
case class TransactionInfo(typeCode: Option[String]) | |
case class Settlement(txnInfo: Option[TransactionInfo]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment