You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NeedForSpeed using Java "Instead of using a loop, consider using a single expression based on one of the comparison operators (i.e. <=, >=, <, >, etc.)."
#226
Open
adhamamr01 opened this issue
Oct 20, 2024
· 2 comments
The suggestion "Instead of using a loop, consider using a single expression based on one of the comparison operators (i.e. <=, >=, <, >, etc.). You can re-use the other methods already implemented in the class or add new ones as needed." shows up as an improvement to the logic of the last task required(canFinishRace(NeedForSpeed car)). However, is it possible to solve it without the loop?
The text was updated successfully, but these errors were encountered:
Hi @adhamamr01! It is possible to solve this one using maths instead of loops. Using maths, it is possible to figure out how much battery is needed or how far the car can travel with the amount remaining. There are some community solutions using this method, such as this one and this one.
Thank you!Sent from my Galaxy
-------- Original message --------From: Kah Goh ***@***.***> Date: 22/10/2024 02:34 (GMT+02:00) To: exercism/java-analyzer ***@***.***> Cc: adhamamr01 ***@***.***>, Mention ***@***.***> Subject: Re: [exercism/java-analyzer] NeedForSpeed using Java "Instead of using a loop, consider using a single expression based on one of the comparison operators (i.e. <=, >=, <, >, etc.)." (Issue #226)
Hi @adhamamr01! It is possible to solve this one using maths instead of loops. Using maths, it is possible to figure out how much battery is needed or how far the car can travel with the amount remaining. There are some community solutions using this method, such as this one and this one.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
The suggestion "Instead of using a loop, consider using a single expression based on one of the comparison operators (i.e. <=, >=, <, >, etc.). You can re-use the other methods already implemented in the class or add new ones as needed." shows up as an improvement to the logic of the last task required(canFinishRace(NeedForSpeed car)). However, is it possible to solve it without the loop?
The text was updated successfully, but these errors were encountered: