Jugwancommunication

Follow Us:

  • Home
  • News
  • FreeSoftware
  • OperatingSystem
  • ComptureLanguage
  • _Python
  • Faridabad Job's
HomeShortCode

Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

byYogesh Rajput -July 29, 2020
0




Find the Minimum Number of Fibonacci Numbers Whose Sum Is K



solution:-
number=int(input("enter the value of number:="))
ans = []
def add(number):
n1=0
n2=1
n4 = [];
n4.extend([1,1])
for i in range(number):
n3 = n2 + n1
n1 = n2
n2 = n3
n4.append(n3)
print(n4)
n = len(n4)
c = 0
for i in range(n - 1, -1, -1):
if n4[i] == number:
print(n4[i])
c += 1
break
elif n4[i]<number:
print(n4[i])
number = number - n4[i]
c += 1
print("Total time of sum",c)
return c

add(number)
Tags: ShortCode
  • Share on Facebook
  • Share on Twitter
You might like

If you have any doubts. Please Let me Know

Post a Comment

If you have any doubts. Please Let me Know

Post a Comment (0)

Previous Post Next Post

Follow Us

Advertisement

Main Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Featured post

Yogesh RajputSeptember 18, 2021

Advertisement

Tags

  • 16 GB RAM
  • 512GB SSD
  • 8 GB RAM
  • BestComputerCourses
  • Dell MS116 1000DPI USB Wired Optical Mouse
  • Excel
  • faridabadjob
  • Free_Software
  • HP 15 (2021) Thin & Light 11th Gen Core i5 Laptop
  • HP Pavilion (2021) Thin & Light 11th Gen Core i5 Laptop
  • Iris Xe Graphics
  • Java
  • JavaScript
  • MSOffice
  • Python
  • ShortCode
  • windows
  • Wired Keyboard and Mouse Combo with 104 Keys and a USB Mouse with

Pages

  • Terms and Conditions
  • Contact Us
  • JavaScriptTutorial
  • Today News

Advertisement

Contact Form