Sum of series
a(n) = n^2 - (n-1)^2
find the summation of the series upto n i.e.
a(1)+a(2)+...+a(n)
7 months ago
Solved
Number of 1s in a binary string
Find the number of 1s in the given binary string.
Example. If the input string is '1100101', the output is 4. If the input stri...