Skip to content

Commit

Permalink
Added spaces between operators and Sample I/O
Browse files Browse the repository at this point in the history
  • Loading branch information
heisastark authored Mar 24, 2020
1 parent 274fb13 commit 0519268
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Karatsuba_Algorithm/Karatsuba_Algorithm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int karatSuba(num1, num2){
String num1Str = num1.toString();
String num2Str = num2.toString();
int n = minof(num1Str.length, num2Str.length);
int half = (n/2).round();
int half = (n / 2).round();

// divide num1 into two halves
int num1_H = int.parse(num1Str.substring(0, num1Str.length - half));
Expand Down Expand Up @@ -46,4 +46,12 @@ void main(){
a = stdin.readLineSync();
b = stdin.readLineSync();
print(karatSuba(int.parse(a), int.parse(b)));
}
}
/*
Sample input:
12345
6789
Sample Output:
83810205
*/

0 comments on commit 0519268

Please sign in to comment.