+ 6
//Today's Challenge // triangle number in a list or array
Given a list/array of numbers try to identify the numbers in the list whose previous number is their triangle number Triangle no eg. If n is a triangle number of x then 1+2+3+... +(n-1)+(n)=x Eg. List = [4,5,3,6,7,28] Output = [6,28] Since 3 and 7 are there triangle numbers
5 Antworten
+ 12
Thank you for the challenge.
Here's my try :
https://code.sololearn.com/cbGNKV5h4wIU/?ref=app
+ 8
+ 5
💟💟🎉🎉🎉
finally, all is done,, Here is the full solution with printed results too.
https://code.sololearn.com/WyOG7vaxzWLG/?ref=app
+ 4
Tried with functional programming.
Would never do it again.
https://code.sololearn.com/cL6Uy6H47e3H/?ref=app