Problem 564. How to subtract?
± ± ± ± ± ± ± ± ± ± ±
- Imagine you need to subtract one number from another using MATLAB.
- You will not be using eval for this task.
- Given two ASCII strings representing two integers X and Y.
- Each of them has only 12 or less ASCII characters.
- Each of them represents signed integers, such as '+2345'
- Please output the result of (X-Y) in a similar style.
Solution Stats
Problem Comments
-
9 Comments
Show
6 older comments
Valeriu Mihailov
on 28 May 2022
how about solving this problem but not using any conversion functions like num2str , str2num , str2double ...
Brandon
on 5 Jun 2023
This problem needed much larger test cases. At least beyond intmax('uint64') range. Also negative inputs were not implemented at all.
Suraj
on 18 Feb 2025
hard
Solution Comments
Show commentsProblem Recent Solvers1514
Suggested Problems
-
Back to basics 22 - Rotate a matrix
915 Solvers
-
427 Solvers
-
5556 Solvers
-
Height of a right-angled triangle
1875 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
1987 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!