Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4c8f65d

Browse files
removed unused code
1 parent 747a44c commit 4c8f65d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

‎src/main/scala/org/codecraftlabs/leetcode/AddBinary.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,13 @@ object AddBinary {
2121
private def dec2Bin(value: BigInt, elements: List[Int]): String = {
2222
value match {
2323
case value if value == 0 => elements.mkString
24-
case x =>
24+
case _ =>
2525
val currentValue = value / 2
2626
val remainder = (value % 2).toInt
2727
dec2Bin(currentValue, remainder :: elements)
2828
}
2929
}
3030

31-
private def binary2Decimal(value: String): BigInt = {
32-
val elements = value.toCharArray.map(item => item.toString.toInt).toList.reverse
33-
bin2Dec(elements, 0, 0)
34-
}
35-
3631
private def bin2Dec(numbers: List[Int], accum: BigInt, exponent: Int): BigInt = {
3732
numbers match {
3833
case Nil => accum

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /