Tag: math
Given a string s consisting only of 1s and 0s, you can delete any two adjacent letters if they are different. Return the length of the smallest string that …
The Fibonacci sequence goes like this: 1, 1, 2, 3, 5, 8, 13, 21, 34, … The next number can be found by adding up the two numbers before …
Given a positive integer num, return the sum of its digits. Bonus: Can you do it without using strings? Example 1 Input num = 123 Output 6 Explanation Since …
Given a equation , let’s find the real value of x. First, divide both sides by which becomes: as , and , it becomes: Let’s replace with and further …
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Input: num1 = “2”, num2 …