TheChetan

Sum Of Substrings

Jul 5th, 2021 (edited)
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. 3. Given a positive integer. Find the sum of all of it's substrings.
  2.  
  3. 4256 -> 4, 2, 5, 6, 42, 25, 56, 425, 256, 4256
  4. Ans: 5077
  5.  
  6.  
  7. Note that 45, 46 etc are not present as they are not substrings
Add Comment
Please, Sign In to add comment