Is a Number Square?
Description:
You decide to take a stroll along the beach with a friend, who happens to be quite fond of mathematics. Perhaps there's more than friendship brewing, and you're eager to impress them. Suddenly, a truck loaded with numbers topples over nearby!. This unexpected event presents you with an opportunity to demonstrate your affection! Your plan: find a number amidst the chaos and confidently declare it a perfect square to sweep your love interest off their feet. However, with numbers scattered everywhere, time is of the essence. You must act swiftly before this romantic moment slips away!
Your task is to implement a function:
fn is_square(n: &BigInt) -> bool
that will return true
if the number is a square number, and false
otherwise
performance specifications:
time for 5,000,000 calculations where 0 < n < 726398497465238697234567235472354723457634528594367282345342697845892354867
must be less then 3.5 seconds
time for 5,000,000 calculations where 0 < n < 1000
must be less then 0.5 seconds
Similar Kata:
Stats:
Created | May 20, 2024 |
Published | May 20, 2024 |
Warriors Trained | 25 |
Total Skips | 1 |
Total Code Submissions | 48 |
Total Times Completed | 4 |
Rust Completions | 4 |
Total Stars | 0 |
% of votes with a positive feedback rating | 50% of 1 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 2 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |