Question: Whats wrong with my code? why time out error appear? The proper factors'* of Integer n are all the factors of n that are less

Whats wrong with my code? why time out error appear? The "properWhats wrong with my code? why time out error appear?

The "proper factors'* of Integer n are all the factors of n that are less than n. So, the factors of 10 are 1, 2 5, and 10, but the proper factors of 10 are just 1, 2, and 5. A number n is "abundant" if Its proper factors add up to more than n. n Is "deficient" if its proper factors add up to less than n. n is "perfect" if its proper factors add up to exactly n. Given a positive integer, return whether the number is abundant, deficient, or perfect. numberType(4) rightarrow "deficient" numberType(6) rightarrow "perfect" numberType(12) rightarrow "abundant" String numberType(int num) {int i-1; int sum-0; String ans=""; while (inum){ans "obundont";} else if (sura else if (sum - num){ans

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!