We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Is there a need to calculate for Tn = 2n-1? As far as I can see the sequence resolves to Sn = n2 as all the other terms cancel out and (n-1)2 for t1 is zero. Wouldn't this give constant time solution? Or am I missing something?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Summing the N series
You are viewing a single comment's thread. Return to all comments →
Is there a need to calculate for Tn = 2n-1? As far as I can see the sequence resolves to Sn = n2 as all the other terms cancel out and (n-1)2 for t1 is zero. Wouldn't this give constant time solution? Or am I missing something?